Skip to content

Commit

Permalink
First batch of update for ribbon 1.x branch.
Browse files Browse the repository at this point in the history
- Added ribbon-rxnetty module for asynchronous HTTP communication based on Netty and RxJava
- IClientConfig and IClientConfigKey supports typed property
- Updates to serialization factory and serializer interfaces (replaced Guava TypeToken with TypeDef in the interfaces)
- Updates to HttpRequest and HttpResponse interfaces with addition of HttpHeaders
  • Loading branch information
Allen Wang committed Jan 9, 2014
1 parent 16bb5be commit d3ca6bc
Show file tree
Hide file tree
Showing 34 changed files with 2,344 additions and 157 deletions.
19 changes: 19 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ project(':ribbon-httpclient') {
}
}

project(':ribbon-rxnetty') {
dependencies {
compile project(':ribbon-core')
compile 'com.netflix.rxnetty:rx-netty:0.2.0'
testCompile project(':ribbon-test')
}
}


project(':ribbon-eureka') {
dependencies {
compile project(':ribbon-core')
Expand Down Expand Up @@ -87,3 +96,13 @@ project(':ribbon-examples') {
}
}

project(':ribbon-test') {
dependencies {
compile project(':ribbon-core')
compile 'com.sun.jersey:jersey-server:1.11'
compile 'javax.ws.rs:jsr311-api:1.1.1'
compile 'com.sun.jersey:jersey-core:1.11'
compile 'junit:junit:4.10'
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ private ClientException generateTimeoutNIWSException(String uri, Throwable e){
* This is called after a response is received or an exception is thrown from the client
* to update related stats.
*/
protected void noteRequestCompletion(ServerStats stats, ClientRequest request, IResponse response, Throwable e, long responseTime) {
protected void noteRequestCompletion(ServerStats stats, ClientRequest request, Object response, Throwable e, long responseTime) {
try {
if (stats != null) {
stats.decrementActiveRequestsCount();
Expand All @@ -259,7 +259,7 @@ protected void noteRequestCompletion(ServerStats stats, ClientRequest request, I
logger.error("Unexpected exception", ex);
}
}

/**
* This is usually called just before client execute a request.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import java.io.InputStream;

import com.google.common.reflect.TypeToken;
import com.netflix.serialization.TypeDef;

/**
* A response type that includes a typed entity in its content.
Expand All @@ -31,7 +31,7 @@ public interface ResponseWithTypedEntity extends IResponse {

public <T> T getEntity(Class<T> type) throws Exception;

public <T> T getEntity(TypeToken<T> type) throws Exception;
public <T> T getEntity(TypeDef<T> type) throws Exception;

public boolean hasEntity();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.netflix.client;

public class UnexpectedResponseException extends Exception {

/**
*
*/
private static final long serialVersionUID = 1L;

public UnexpectedResponseException(String arg0, Throwable arg1) {
super(arg0, arg1);
}

public UnexpectedResponseException(String arg0) {
super(arg0);
}

public UnexpectedResponseException(Throwable arg0) {
super(arg0);
}
}
Loading

0 comments on commit d3ca6bc

Please sign in to comment.