<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: mac</li>
<li>Java version: JDK8</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="ConfigCenterConfig.java
    @Parameter(key = CONFIG_NAMESPACE_KEY, useKeyAsProperty = false)
    public String getNamespace() {
        return namespace;
    }"><pre class="notranslate"><span class="pl-smi">ConfigCenterConfig</span>.<span class="pl-smi">java</span>
    <span class="pl-c1">@</span><span class="pl-c1">Parameter</span>(<span class="pl-s1">key</span> = <span class="pl-c1">CONFIG_NAMESPACE_KEY</span>, <span class="pl-s1">useKeyAsProperty</span> = <span class="pl-c1">false</span>)
    <span class="pl-k">public</span> <span class="pl-smi">String</span> <span class="pl-s1">getNamespace</span>() {
        <span class="pl-k">return</span> <span class="pl-s1">namespace</span>;
    }</pre></div>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="AbstractConfig.java
      Parameter parameter = method.getAnnotation(Parameter.class);
      if (parameter != null &amp;&amp; parameter.key().length() &gt; 0 &amp;&amp; parameter.useKeyAsProperty()) {
               key = parameter.key();
       } else {
              key = prop;
       }"><pre class="notranslate"><span class="pl-smi">AbstractConfig</span>.<span class="pl-smi">java</span>
      <span class="pl-s1">Parameter</span> <span class="pl-s1">parameter</span> = <span class="pl-s1">method</span>.<span class="pl-en">getAnnotation</span>(<span class="pl-smi">Parameter</span>.<span class="pl-k">class</span>);
      <span class="pl-k">if</span> (<span class="pl-s1">parameter</span> != <span class="pl-c1">null</span> &amp;&amp; <span class="pl-s1">parameter</span>.<span class="pl-en">key</span>().<span class="pl-en">length</span>() &gt; <span class="pl-c1">0</span> &amp;&amp; <span class="pl-s1">parameter</span>.<span class="pl-en">useKeyAsProperty</span>()) {
               <span class="pl-s1">key</span> = <span class="pl-s1">parameter</span>.<span class="pl-en">key</span>();
       } <span class="pl-k">else</span> {
              <span class="pl-s1">key</span> = <span class="pl-s1">prop</span>;
       }</pre></div>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="ZookeeperDynamicConfiguration.java
rootPath = &quot;/&quot; + url.getParameter(CONFIG_NAMESPACE_KEY, DEFAULT_GROUP) + &quot;/config&quot;;"><pre class="notranslate"><span class="pl-smi">ZookeeperDynamicConfiguration</span>.<span class="pl-smi">java</span>
<span class="pl-s1">rootPath</span> = <span class="pl-s">"/"</span> + <span class="pl-s1">url</span>.<span class="pl-en">getParameter</span>(<span class="pl-c1">CONFIG_NAMESPACE_KEY</span>, <span class="pl-c1">DEFAULT_GROUP</span>) + <span class="pl-s">"/config"</span>;</pre></div>
<h4 dir="auto">问题</h4>
<blockquote>
<p dir="auto">在dubbo-admin中定义了黑白名单，设置了分组<code class="notranslate">admin.registry.group=henry1</code>，保存到zk<code class="notranslate">/root/henry1/config</code>下</p>
</blockquote>
<blockquote>
<p dir="auto">设置属性<code class="notranslate">dubbo.config-center.group=henry1 dubbo.config-center.namespace=henry1</code> consumer端启动，但是在<code class="notranslate">ZookeeperDynamicConfiguration</code>取出来的值发现是<code class="notranslate">dubbo</code>，导致规则获取失败。</p>
</blockquote>
<h4 dir="auto">原因</h4>
<blockquote>
<p dir="auto">因为<code class="notranslate">getNamespace</code>的<code class="notranslate">useKeyAsProperty</code>为false，在<code class="notranslate">AbstractConfig</code>解析时取的key为<code class="notranslate">namespace</code>不是<code class="notranslate">config.namespace</code>。在<code class="notranslate">ZookeeperDynamicConfiguration</code>取<code class="notranslate">CONFIG_NAMESPACE_KEY</code>为NULL</p>
</blockquote>
<blockquote>
<p dir="auto">是否需要把<code class="notranslate">getNamespace</code>的<code class="notranslate">useKeyAsProperty</code>改为true，或者是修改<code class="notranslate">ZookeeperDynamicConfiguration</code>的取值key</p>
</blockquote>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<blockquote>
<p dir="auto">希望在<code class="notranslate">ZookeeperDynamicConfiguration</code>可以获取到值，而不是默认值</p>
</blockquote>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.1</li>
<li>Dubbo Admin version: 0.2.0</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto">在dubbo-admin中添加权重设置和负载均衡设置<br>
在zookeeper里面能看到设置的结果在config下面<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/26532831/56106546-4b8eb700-5f74-11e9-8108-ffde0fb8128b.png"><img width="1342" alt="a000" src="https://user-images.githubusercontent.com/26532831/56106546-4b8eb700-5f74-11e9-8108-ffde0fb8128b.png" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/26532831/56106550-51849800-5f74-11e9-8ec6-a866f850206f.png"><img width="965" alt="a1111" src="https://user-images.githubusercontent.com/26532831/56106550-51849800-5f74-11e9-8ec6-a866f850206f.png" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/26532831/56106559-577a7900-5f74-11e9-9ece-441442a42814.png"><img width="1617" alt="a2222" src="https://user-images.githubusercontent.com/26532831/56106559-577a7900-5f74-11e9-9ece-441442a42814.png" style="max-width: 100%;"></a></p>
<p dir="auto">但是实际dubbo在调用时，并没有从config下面获取配置，仍然从服务接口下面的配置中获取，到账新的配置不生效，而且从服务接口拿配置，也没有应用级一说，仍是服务级</p>