Skip to content

Commit

Permalink
Merge pull request #749 from Just-CJ:master
Browse files Browse the repository at this point in the history
Optimize route: route on service level, then on method level
  • Loading branch information
Just-CJ authored and chickenlj committed Oct 23, 2017
1 parent 9ef40ca commit 62fae04
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -486,12 +486,13 @@ private Map<String, List<Invoker<T>>> toMethodInvokers(Map<String, Invoker<T>> i
invokersList.add(invoker);
}
}
newMethodInvokerMap.put(Constants.ANY_VALUE, invokersList);
List<Invoker<T>> newInvokersList = route(invokersList, null);
newMethodInvokerMap.put(Constants.ANY_VALUE, newInvokersList);
if (serviceMethods != null && serviceMethods.length > 0) {
for (String method : serviceMethods) {
List<Invoker<T>> methodInvokers = newMethodInvokerMap.get(method);
if (methodInvokers == null || methodInvokers.size() == 0) {
methodInvokers = invokersList;
methodInvokers = newInvokersList;
}
newMethodInvokerMap.put(method, route(methodInvokers, method));
}
Expand Down

0 comments on commit 62fae04

Please sign in to comment.