Commit ce6d286d by Spencer Gibb

Don't execute load balancer twice

fixes gh-323
parent b28fd07c
...@@ -108,14 +108,20 @@ public class RibbonClientHttpRequestFactory implements ClientHttpRequestFactory ...@@ -108,14 +108,20 @@ public class RibbonClientHttpRequestFactory implements ClientHttpRequestFactory
@Override @Override
protected ClientHttpResponse executeInternal(HttpHeaders headers) protected ClientHttpResponse executeInternal(HttpHeaders headers)
throws IOException { throws IOException {
// use execute here so stats are collected try {
return loadBalancer.execute(this.config.getClientName(), new LoadBalancerRequest<ClientHttpResponse>() { HttpResponse response = client.execute(request, config);
return new RibbonHttpResponse(response);
} catch (Exception e) {
throw new IOException(e);
}
//TODO: fix stats, now that execute is not called
// use execute here so stats are collected
/*return loadBalancer.execute(this.config.getClientName(), new LoadBalancerRequest<ClientHttpResponse>() {
@Override @Override
public ClientHttpResponse apply(ServiceInstance instance) throws Exception { public ClientHttpResponse apply(ServiceInstance instance) throws Exception {
HttpResponse response = client.execute(request, config);
return new RibbonHttpResponse(response);
} }
}); });*/
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment