<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.3</li>
<li>Operating System version: Mac</li>
<li>Java version: 8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<h3 dir="auto">原因</h3>
<blockquote>
<p dir="auto">使用zdubbo-admin新建条件路由，目录为<code class="notranslate">/configCenterGroup/config/demo-consumer.condition-router</code>这里没有namespace概念，其实整个zdubbo -admin也没这个概念</p>
</blockquote>
<blockquote>
<p dir="auto">然后dubbo consumer启动时，需要配置<code class="notranslate">namespace="configCenterGroup"</code>，然后在<code class="notranslate">ListenableRouter</code>获取规则时，通过<code class="notranslate">namespace</code>+<code class="notranslate">group</code>来获取的，结果是<code class="notranslate">/configCenterGroup/config/dubbo/demo-consumer.condition-router</code>。但是group又是默认值又是dubbo。导致规则取不出来</p>
</blockquote>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    private synchronized void init(String ruleKey) {
        if (StringUtils.isEmpty(ruleKey)) {
            return;
        }
        String routerKey = ruleKey + RULE_SUFFIX;
        configuration.addListener(routerKey, this);
        String rule = configuration.getRule(routerKey, DynamicConfiguration.DEFAULT_GROUP);
        if (StringUtils.isNotEmpty(rule)) {
            this.process(new ConfigChangeEvent(routerKey, rule));
        }
    }"><pre class="notranslate">    <span class="pl-k">private</span> <span class="pl-k">synchronized</span> <span class="pl-smi">void</span> <span class="pl-s1">init</span>(<span class="pl-smi">String</span> <span class="pl-s1">ruleKey</span>) {
        <span class="pl-k">if</span> (<span class="pl-smi">StringUtils</span>.<span class="pl-en">isEmpty</span>(<span class="pl-s1">ruleKey</span>)) {
            <span class="pl-k">return</span>;
        }
        <span class="pl-smi">String</span> <span class="pl-s1">routerKey</span> = <span class="pl-s1">ruleKey</span> + <span class="pl-c1">RULE_SUFFIX</span>;
        <span class="pl-s1">configuration</span>.<span class="pl-en">addListener</span>(<span class="pl-s1">routerKey</span>, <span class="pl-smi">this</span>);
        <span class="pl-smi">String</span> <span class="pl-s1">rule</span> = <span class="pl-s1">configuration</span>.<span class="pl-en">getRule</span>(<span class="pl-s1">routerKey</span>, <span class="pl-smi">DynamicConfiguration</span>.<span class="pl-c1">DEFAULT_GROUP</span>);
        <span class="pl-k">if</span> (<span class="pl-smi">StringUtils</span>.<span class="pl-en">isNotEmpty</span>(<span class="pl-s1">rule</span>)) {
            <span class="pl-smi">this</span>.<span class="pl-en">process</span>(<span class="pl-k">new</span> <span class="pl-smi">ConfigChangeEvent</span>(<span class="pl-s1">routerKey</span>, <span class="pl-s1">rule</span>));
        }
    }</pre></div>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<blockquote>
<p dir="auto">是否需要修改zdubbo-admin加上namespace这个概念，然后是否需要修改dubbo代码，group不能写死成默认值</p>
</blockquote>
<h3 dir="auto">Actual Result</h3>
<blockquote>
<p dir="auto">zdubbo-admin新增属性：admin.config-center.namespace=</p>
</blockquote>
<blockquote>
<p dir="auto"><code class="notranslate">String rule = configuration.getRule(routerKey, DynamicConfiguration.DEFAULT_GROUP);</code>group写活<br>
What actually happens?</p>
</blockquote>
<p dir="auto">If there is an exception, please attach the exception trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Just put your stack trace here!"><pre class="notranslate"><code class="notranslate">Just put your stack trace here!
</code></pre></div>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/incubator-dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/incubator-dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.6.2</li>
<li>Operating System version: Linux</li>
<li>Java version: 8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>添加路由</li>
<li>指定相同的priority</li>
<li>引发异常：java.lang.IllegalArgumentException: Comparison method violates its general contract!<br>
查看源码 ConditionRouter、ScriptRouter、TagRouter 的 compareTo 方法实现类似，会引发同类问题。</li>
</ol>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">What do you expected from the above steps？</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">What actually happens?</p>
<p dir="auto">If there is an exception, please attach the exception trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry  -  [DUBBO] Failed to notify for subscribe consumer://xx.xx.xx.xx/com.xxx.service.XxxService?application=xxx-service&amp;category=providers,configurators,routers&amp;default.check=true&amp;dubbo=2.6.2&amp;interface=com.xxx.service.XxxService&amp;methods=getXxx,setXxx&amp;owner=xxx&amp;pid=160275&amp;revision=3.5.9&amp;side=consumer&amp;timeout=10000×tamp=1542092651604, waiting for retry, cause: Comparison method violates its general contract!, dubbo version: 2.6.2, current host: xx.xx.xx
java.lang.IllegalArgumentException: Comparison method violates its general contract!
	at java.util.ComparableTimSort.mergeLo(ComparableTimSort.java:740)
	at java.util.ComparableTimSort.mergeAt(ComparableTimSort.java:477)
	at java.util.ComparableTimSort.mergeCollapse(ComparableTimSort.java:402)
	at java.util.ComparableTimSort.sort(ComparableTimSort.java:209)
	at java.util.Arrays.sort(Arrays.java:1312)
	at java.util.Arrays.sort(Arrays.java:1506)
	at java.util.ArrayList.sort(ArrayList.java:1454)
	at java.util.Collections.sort(Collections.java:141)
	at com.alibaba.dubbo.rpc.cluster.directory.AbstractDirectory.setRouters(AbstractDirectory.java:110)
	at com.alibaba.dubbo.registry.integration.RegistryDirectory.notify(RegistryDirectory.java:211)
	at com.alibaba.dubbo.registry.support.AbstractRegistry.notify(AbstractRegistry.java:414)
	at com.alibaba.dubbo.registry.support.FailbackRegistry.doNotify(FailbackRegistry.java:274)
	at com.alibaba.dubbo.registry.support.FailbackRegistry.notify(FailbackRegistry.java:260)
	at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.doSubscribe(ZookeeperRegistry.java:190)
	at com.alibaba.dubbo.registry.support.FailbackRegistry.subscribe(FailbackRegistry.java:190)
	at com.alibaba.dubbo.registry.integration.RegistryDirectory.subscribe(RegistryDirectory.java:159)
	at com.alibaba.dubbo.registry.integration.RegistryProtocol.doRefer(RegistryProtocol.java:305)
	at com.alibaba.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:286)
	at com.alibaba.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:63)
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:106)
	at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:65)
	at com.alibaba.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java)
	at com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:394)
	at com.alibaba.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:333)
	at com.alibaba.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:163)
	at com.alibaba.dubbo.config.spring.ReferenceBean.getObject(ReferenceBean.java:66)"><pre class="notranslate"><code class="notranslate">ERROR com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry  -  [DUBBO] Failed to notify for subscribe consumer://xx.xx.xx.xx/com.xxx.service.XxxService?application=xxx-service&amp;category=providers,configurators,routers&amp;default.check=true&amp;dubbo=2.6.2&amp;interface=com.xxx.service.XxxService&amp;methods=getXxx,setXxx&amp;owner=xxx&amp;pid=160275&amp;revision=3.5.9&amp;side=consumer&amp;timeout=10000×tamp=1542092651604, waiting for retry, cause: Comparison method violates its general contract!, dubbo version: 2.6.2, current host: xx.xx.xx
java.lang.IllegalArgumentException: Comparison method violates its general contract!
	at java.util.ComparableTimSort.mergeLo(ComparableTimSort.java:740)
	at java.util.ComparableTimSort.mergeAt(ComparableTimSort.java:477)
	at java.util.ComparableTimSort.mergeCollapse(ComparableTimSort.java:402)
	at java.util.ComparableTimSort.sort(ComparableTimSort.java:209)
	at java.util.Arrays.sort(Arrays.java:1312)
	at java.util.Arrays.sort(Arrays.java:1506)
	at java.util.ArrayList.sort(ArrayList.java:1454)
	at java.util.Collections.sort(Collections.java:141)
	at com.alibaba.dubbo.rpc.cluster.directory.AbstractDirectory.setRouters(AbstractDirectory.java:110)
	at com.alibaba.dubbo.registry.integration.RegistryDirectory.notify(RegistryDirectory.java:211)
	at com.alibaba.dubbo.registry.support.AbstractRegistry.notify(AbstractRegistry.java:414)
	at com.alibaba.dubbo.registry.support.FailbackRegistry.doNotify(FailbackRegistry.java:274)
	at com.alibaba.dubbo.registry.support.FailbackRegistry.notify(FailbackRegistry.java:260)
	at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.doSubscribe(ZookeeperRegistry.java:190)
	at com.alibaba.dubbo.registry.support.FailbackRegistry.subscribe(FailbackRegistry.java:190)
	at com.alibaba.dubbo.registry.integration.RegistryDirectory.subscribe(RegistryDirectory.java:159)
	at com.alibaba.dubbo.registry.integration.RegistryProtocol.doRefer(RegistryProtocol.java:305)
	at com.alibaba.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:286)
	at com.alibaba.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:63)
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:106)
	at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:65)
	at com.alibaba.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java)
	at com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:394)
	at com.alibaba.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:333)
	at com.alibaba.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:163)
	at com.alibaba.dubbo.config.spring.ReferenceBean.getObject(ReferenceBean.java:66)
</code></pre></div>