Skip to content

Commit

Permalink
tag router supports anyhost (apache#4431)
Browse files Browse the repository at this point in the history
  • Loading branch information
cvictory authored and chickenlj committed Sep 17, 2019
1 parent dbb0a64 commit fb1f98b
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import java.util.function.Predicate;
import java.util.stream.Collectors;

import static org.apache.dubbo.common.constants.CommonConstants.ANYHOST_VALUE;
import static org.apache.dubbo.rpc.Constants.FORCE_USE_TAG;
import static org.apache.dubbo.rpc.cluster.Constants.TAG_KEY;

Expand All @@ -52,6 +53,7 @@ public class TagRouter extends AbstractRouter implements ConfigurationListener {
private static final Logger logger = LoggerFactory.getLogger(TagRouter.class);
private static final String RULE_SUFFIX = ".tag-router";


private TagRouterRule tagRouterRule;
private String application;

Expand Down Expand Up @@ -212,6 +214,9 @@ private boolean checkAddressMatch(List<String> addresses, String host, int port)
if (NetUtils.matchIpExpression(address, host, port)) {
return true;
}
if ((ANYHOST_VALUE + ":" + port).equals(address)) {
return true;
}
} catch (UnknownHostException e) {
logger.error("The format of ip address is invalid in tag route. Address :" + address, e);
} catch (Exception e) {
Expand Down

0 comments on commit fb1f98b

Please sign in to comment.