Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ public LoadbalanceHandler() {

private void preCheck() {
// Old configurations check.Just print an error, because configurations may given in dynamic and fail on runtime.

String policyName = DynamicPropertyFactory.getInstance()
.getStringProperty("servicecomb.loadbalance.NFLoadBalancerRuleClassName", null)
.get();
Expand All @@ -115,8 +114,9 @@ public void handle(Invocation invocation, AsyncResponse asyncResp) throws Except
response.handle(async);
};

if (handleSuppliedEndpoint(invocation, asyncResp)) {
if (handleSuppliedEndpoint(invocation)) {
invocation.addLocalContext(RetryContext.RETRY_LOAD_BALANCE, false);
invocation.next(asyncResp);
return;
}
invocation.addLocalContext(RetryContext.RETRY_LOAD_BALANCE, true);
Expand All @@ -137,15 +137,13 @@ public void handle(Invocation invocation, AsyncResponse asyncResp) throws Except

// user's can invoke a service by supplying target Endpoint.
// in this case, we do not using load balancer, and no stats of server calculated, no retrying.
private boolean handleSuppliedEndpoint(Invocation invocation,
AsyncResponse asyncResp) throws Exception {
private boolean handleSuppliedEndpoint(Invocation invocation) throws Exception {
if (invocation.getEndpoint() != null) {
invocation.next(asyncResp);
return true;
}

if (supportDefinedEndpoint) {
return defineEndpointAndHandle(invocation, asyncResp);
return defineEndpointAndHandle(invocation);
}

return false;
Expand All @@ -162,7 +160,7 @@ private Endpoint parseEndpoint(String endpointUri) throws Exception {
return new Endpoint(transport, endpointUri);
}

private boolean defineEndpointAndHandle(Invocation invocation, AsyncResponse asyncResp) throws Exception {
private boolean defineEndpointAndHandle(Invocation invocation) throws Exception {
Object endpoint = invocation.getLocalContext(SERVICECOMB_SERVER_ENDPOINT);
if (endpoint == null) {
return false;
Expand All @@ -173,7 +171,6 @@ private boolean defineEndpointAndHandle(Invocation invocation, AsyncResponse asy
}

invocation.setEndpoint((Endpoint) endpoint);
invocation.next(asyncResp);
return true;
}

Expand Down
Loading