You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2018/09/19 04:47:25 UTC

[GitHub] chickenlj closed pull request #2322: [DUBBO-2321]Provider "async = true" need to be remove from url when register to registry#2321

chickenlj closed pull request #2322: [DUBBO-2321]Provider "async = true" need to be remove from url when register to registry#2321
URL: https://github.com/apache/incubator-dubbo/pull/2322
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java
index 63744566ea..2e25f7cd4b 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java
@@ -43,6 +43,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -222,6 +223,14 @@ private URL getRegistryUrl(Invoker<?> originInvoker) {
      */
     private URL getRegisteredProviderUrl(final Invoker<?> originInvoker) {
         URL providerUrl = getProviderUrl(originInvoker);
+        // Remove the async tag here, leaving only the tag at the provider, and not register to registry.
+        Set<String> keySet = providerUrl.getParameters().keySet();
+        List<String> asyncKey = new ArrayList<String>();
+        for(String key : keySet) {
+            if(key.endsWith("." + Constants.ASYNC_KEY) || key.equals(Constants.ASYNC_KEY)) {
+                asyncKey.add(key);
+            }
+        }
         //The address you see at the registry
         return providerUrl.removeParameters(getFilteredKeys(providerUrl))
                 .removeParameter(Constants.MONITOR_KEY)
@@ -231,7 +240,8 @@ private URL getRegisteredProviderUrl(final Invoker<?> originInvoker) {
                 .removeParameter(QOS_PORT)
                 .removeParameter(ACCEPT_FOREIGN_IP)
                 .removeParameter(VALIDATION_KEY)
-                .removeParameter(INTERFACES);
+                .removeParameter(INTERFACES)
+                .removeParameters(asyncKey);
     }
 
     private URL getSubscribedOverrideUrl(URL registedProviderUrl) {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org