You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2019/09/17 01:56:29 UTC

[dubbo] branch master updated: tag router supports anyhost (#4431)

This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/master by this push:
     new fb1f98b  tag router supports  anyhost (#4431)
fb1f98b is described below

commit fb1f98b60c70c9b7d76949b48367fd6d39794a5c
Author: cvictory <sh...@gmail.com>
AuthorDate: Tue Sep 17 09:56:09 2019 +0800

    tag router supports  anyhost (#4431)
    
    Fixes #4393
---
 .../main/java/org/apache/dubbo/rpc/cluster/router/tag/TagRouter.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/tag/TagRouter.java b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/tag/TagRouter.java
index c96f6a2..d8b35bc 100644
--- a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/tag/TagRouter.java
+++ b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/tag/TagRouter.java
@@ -40,6 +40,7 @@ import java.util.List;
 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;
 
@@ -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;
 
@@ -212,6 +214,9 @@ public class TagRouter extends AbstractRouter implements ConfigurationListener {
                 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) {