<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> 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" checked=""> 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: master<br>
I find some code in these place:<br>
<div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/apache/dubbo/blob/683db2b1b2e2af0bb7718005f54d74d8000cf41f/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/loadbalance/ConsistentHashLoadBalance.java#L91">dubbo/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/loadbalance/ConsistentHashLoadBalance.java</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 91
      in
      <a data-pjax="true" class="commit-tease-sha" href="/apache/dubbo/commit/683db2b1b2e2af0bb7718005f54d74d8000cf41f">683db2b</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L91" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="91"></td>
          <td id="LC91" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-smi">byte</span>[] <span class="pl-s1">digest</span> = <span class="pl-en">md5</span>(<span class="pl-s1">address</span> + <span class="pl-s1">i</span>); </td>
        </tr>
    </tbody></table>
  </div>
</div>
</li>
</ul>
<p dir="auto"></p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/apache/dubbo/blob/683db2b1b2e2af0bb7718005f54d74d8000cf41f/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/loadbalance/ConsistentHashLoadBalance.java#L102">dubbo/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/loadbalance/ConsistentHashLoadBalance.java</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 102
      in
      <a data-pjax="true" class="commit-tease-sha" href="/apache/dubbo/commit/683db2b1b2e2af0bb7718005f54d74d8000cf41f">683db2b</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L102" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="102"></td>
          <td id="LC102" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-smi">byte</span>[] <span class="pl-s1">digest</span> = <span class="pl-en">md5</span>(<span class="pl-s1">key</span>); </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<p dir="auto">Thet use a self define md5 method.But I found a md5 method defined in:<br>
</p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/apache/dubbo/blob/683db2b1b2e2af0bb7718005f54d74d8000cf41f/dubbo-common/src/main/java/org/apache/dubbo/common/io/Bytes.java#L824-L826">dubbo/dubbo-common/src/main/java/org/apache/dubbo/common/io/Bytes.java</a>
    </p>
    <p class="mb-0 color-fg-muted">
        Lines 824 to 826
      in
      <a data-pjax="true" class="commit-tease-sha" href="/apache/dubbo/commit/683db2b1b2e2af0bb7718005f54d74d8000cf41f">683db2b</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L824" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="824"></td>
          <td id="LC824" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">public</span> <span class="pl-k">static</span> <span class="pl-smi">byte</span>[] <span class="pl-en">getMD5</span>(<span class="pl-smi">String</span> <span class="pl-s1">str</span>) { </td>
        </tr>

        <tr class="border-0">
          <td id="L825" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="825"></td>
          <td id="LC825" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-k">return</span> <span class="pl-en">getMD5</span>(<span class="pl-s1">str</span>.<span class="pl-en">getBytes</span>()); </td>
        </tr>

        <tr class="border-0">
          <td id="L826" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="826"></td>
          <td id="LC826" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> } </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<p dir="auto">If there is no other reason,I think they can be replaced with <code class="notranslate">byte[] digest = Bytes.getMD5(key);</code>.</p>
<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.5</li>
<li>Operating System version: macOS 10.15.3 (19D76)</li>
<li>Java version: 1.8.241</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>启用将metadata保存至remote的方式为dubbo.application.metadata-type=remote</li>
<li>配置dubbo.metadata-report.adress=nacos://127.0.0.1:8848</li>
<li>无法在Nacos查看服务元数据</li>
</ol>
<p dir="auto">为导出服务的URL生成的metadata相关的参数名为metadata.type，但常量METADATA_KEY的值为metadata。因此获得的WritableMetadataService为InMemoryWritableMetadataService，导致无法将元数据保存到remote</p>
<p dir="auto">org.apache.dubbo.config.ServiceConfig#487</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="WritableMetadataService metadataService = WritableMetadataService.getExtension(url.getParameter(METADATA_KEY, DEFAULT_METADATA_STORAGE_TYPE));
                if (metadataService != null) {
                    metadataService.publishServiceDefinition(url);
                }"><pre class="notranslate"><span class="pl-smi">WritableMetadataService</span> <span class="pl-s1">metadataService</span> = <span class="pl-smi">WritableMetadataService</span>.<span class="pl-en">getExtension</span>(<span class="pl-s1">url</span>.<span class="pl-en">getParameter</span>(<span class="pl-c1">METADATA_KEY</span>, <span class="pl-c1">DEFAULT_METADATA_STORAGE_TYPE</span>));
                <span class="pl-k">if</span> (<span class="pl-s1">metadataService</span> != <span class="pl-c1">null</span>) {
                    <span class="pl-s1">metadataService</span>.<span class="pl-en">publishServiceDefinition</span>(<span class="pl-s1">url</span>);
                }</pre></div>