Skip to content

Commit 3a05378

Browse files
kexianjunralf0131
authored andcommitted
Simply TagRouter (#2924)
1 parent 6990134 commit 3a05378

File tree

1 file changed

+3
-11
lines changed
  • dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/tag

1 file changed

+3
-11
lines changed

dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/tag/TagRouter.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,10 @@ public <T> List<Invoker<T>> route(List<Invoker<T>> invokers, URL url, Invocation
7272
result.add(invoker);
7373
}
7474
}
75-
// If no invoker be selected, downgrade to normal invokers
76-
if (result.isEmpty()) {
77-
for (Invoker<T> invoker : invokers) {
78-
if (StringUtils.isEmpty(invoker.getUrl().getParameter(Constants.TAG_KEY))) {
79-
result.add(invoker);
80-
}
81-
}
82-
}
83-
// Normal request
84-
} else {
75+
}
76+
// If Constants.REQUEST_TAG_KEY unspecified or no invoker be selected, downgrade to normal invokers
77+
if (result.isEmpty()) {
8578
for (Invoker<T> invoker : invokers) {
86-
// Can't access tag invoker,only normal invoker should be selected
8779
if (StringUtils.isEmpty(invoker.getUrl().getParameter(Constants.TAG_KEY))) {
8880
result.add(invoker);
8981
}

0 commit comments

Comments
 (0)