<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: xxx</li>
<li>Operating System version: xxx</li>
<li>Java version: xxx</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>xxx</li>
<li>xxx</li>
<li>xxx</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="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/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.2</li>
<li>Operating System version: xxx</li>
<li>Java version: xxx</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public void removeListener(String key, String group, ConfigurationListener listener) {
        cacheListener.removeListener(key, listener);
    }

    @Override
    public String getConfig(String key, String group, long timeout) throws IllegalStateException {
        /**
         * when group is not null, we are getting startup configs from Config Center, for example:
         * group=dubbo, key=dubbo.properties
         */
        if (StringUtils.isNotEmpty(group)) {
            key = group + &quot;/&quot; + key;
        }
        /**
         * when group is null, we are fetching governance rules, for example:
         * 1. key=org.apache.dubbo.DemoService.configurators
         * 2. key = org.apache.dubbo.DemoService.condition-router
         */
        else {
            int i = key.lastIndexOf(&quot;.&quot;);
            key = key.substring(0, i) + &quot;/&quot; + key.substring(i + 1);
        }

        return (String) getInternalProperty(rootPath + &quot;/&quot; + key);
    }"><pre class="notranslate"><span class="pl-k">public</span> <span class="pl-smi">void</span> <span class="pl-s1">removeListener</span>(<span class="pl-smi">String</span> <span class="pl-s1">key</span>, <span class="pl-smi">String</span> <span class="pl-s1">group</span>, <span class="pl-smi">ConfigurationListener</span> <span class="pl-s1">listener</span>) {
        <span class="pl-s1">cacheListener</span>.<span class="pl-en">removeListener</span>(<span class="pl-s1">key</span>, <span class="pl-s1">listener</span>);
    }

    <span class="pl-c1">@</span><span class="pl-c1">Override</span>
    <span class="pl-k">public</span> <span class="pl-smi">String</span> <span class="pl-s1">getConfig</span>(<span class="pl-smi">String</span> <span class="pl-s1">key</span>, <span class="pl-smi">String</span> <span class="pl-s1">group</span>, <span class="pl-smi">long</span> <span class="pl-s1">timeout</span>) <span class="pl-k">throws</span> <span class="pl-s1">IllegalStateException</span> {
        <span class="pl-c">/**</span>
<span class="pl-c">         * when group is not null, we are getting startup configs from Config Center, for example:</span>
<span class="pl-c">         * group=dubbo, key=dubbo.properties</span>
<span class="pl-c">         */</span>
        <span class="pl-k">if</span> (<span class="pl-smi">StringUtils</span>.<span class="pl-en">isNotEmpty</span>(<span class="pl-s1">group</span>)) {
            <span class="pl-s1">key</span> = <span class="pl-s1">group</span> + <span class="pl-s">"/"</span> + <span class="pl-s1">key</span>;
        }
        <span class="pl-c">/**</span>
<span class="pl-c">         * when group is null, we are fetching governance rules, for example:</span>
<span class="pl-c">         * 1. key=org.apache.dubbo.DemoService.configurators</span>
<span class="pl-c">         * 2. key = org.apache.dubbo.DemoService.condition-router</span>
<span class="pl-c">         */</span>
        <span class="pl-k">else</span> {
            <span class="pl-smi">int</span> <span class="pl-s1">i</span> = <span class="pl-s1">key</span>.<span class="pl-en">lastIndexOf</span>(<span class="pl-s">"."</span>);
            <span class="pl-s1">key</span> = <span class="pl-s1">key</span>.<span class="pl-en">substring</span>(<span class="pl-c1">0</span>, <span class="pl-s1">i</span>) + <span class="pl-s">"/"</span> + <span class="pl-s1">key</span>.<span class="pl-en">substring</span>(<span class="pl-s1">i</span> + <span class="pl-c1">1</span>);
        }

        <span class="pl-k">return</span> (<span class="pl-smi">String</span>) <span class="pl-en">getInternalProperty</span>(<span class="pl-s1">rootPath</span> + <span class="pl-s">"/"</span> + <span class="pl-s1">key</span>);
    }</pre></div>
<p dir="auto">addListener and getConfig used different path, so only one of the could get data from configcenter</p>
<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="Just put your stack trace here!"><pre class="notranslate"><code class="notranslate">Just put your stack trace here!
</code></pre></div>