You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/08/30 03:16:51 UTC

[dubbo] branch 3.0-multi-instances updated (945e903 -> f3aff3b)

This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a change to branch 3.0-multi-instances
in repository https://gitbox.apache.org/repos/asf/dubbo.git.


    from 945e903  Invocation pass ServiceModel
     new 5af136c  Compact old style registerConsumer
     new f3aff3b  Fix NPE in RpcInvocation

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/dubbo/rpc/model/ServiceRepository.java    | 11 ++++++++++-
 .../src/main/java/org/apache/dubbo/rpc/RpcInvocation.java     |  4 ++--
 2 files changed, 12 insertions(+), 3 deletions(-)

[dubbo] 02/02: Fix NPE in RpcInvocation

Posted by al...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch 3.0-multi-instances
in repository https://gitbox.apache.org/repos/asf/dubbo.git

commit f3aff3b2dc298383cb240fda817555c99a95ccae
Author: Albumen Kevin <jh...@gmail.com>
AuthorDate: Mon Aug 30 11:16:23 2021 +0800

    Fix NPE in RpcInvocation
---
 .../src/main/java/org/apache/dubbo/rpc/RpcInvocation.java             | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/RpcInvocation.java b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/RpcInvocation.java
index c7e7187..a828ca0 100644
--- a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/RpcInvocation.java
+++ b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/RpcInvocation.java
@@ -179,10 +179,10 @@ public class RpcInvocation implements Invocation, Serializable {
     }
 
     private void initParameterDesc() {
-        ServiceDescriptor serviceDescriptor;
+        ServiceDescriptor serviceDescriptor = null;
         if (serviceModel != null) {
             serviceDescriptor = serviceModel.getServiceModel();
-        } else {
+        } else if (StringUtils.isNotEmpty(serviceName)){
             ServiceRepository repository = ApplicationModel.defaultModel().getApplicationServiceRepository();
             serviceDescriptor = repository.lookupService(serviceName);
         }

[dubbo] 01/02: Compact old style registerConsumer

Posted by al...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch 3.0-multi-instances
in repository https://gitbox.apache.org/repos/asf/dubbo.git

commit 5af136c3e116cbcfa99927928808e695c444f7aa
Author: Albumen Kevin <jh...@gmail.com>
AuthorDate: Mon Aug 30 11:14:07 2021 +0800

    Compact old style registerConsumer
---
 .../java/org/apache/dubbo/rpc/model/ServiceRepository.java    | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/dubbo-common/src/main/java/org/apache/dubbo/rpc/model/ServiceRepository.java b/dubbo-common/src/main/java/org/apache/dubbo/rpc/model/ServiceRepository.java
index a004d5a..e73caea 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/rpc/model/ServiceRepository.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/rpc/model/ServiceRepository.java
@@ -30,8 +30,8 @@ import org.apache.dubbo.config.ServiceConfigBase;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-import java.util.Set;
 import java.util.Map;
+import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 
@@ -110,6 +110,15 @@ public class ServiceRepository extends LifecycleAdapter implements FrameworkExt,
                                  ServiceDescriptor serviceDescriptor,
                                  ReferenceConfigBase<?> rc,
                                  Object proxy,
+                                 ServiceMetadata serviceMetadata) {
+        ConsumerModel consumerModel = new ConsumerModel(serviceMetadata.getServiceKey(), proxy, serviceDescriptor, rc,
+            serviceMetadata, null);
+        consumers.putIfAbsent(serviceKey, consumerModel);
+    }
+    public void registerConsumer(String serviceKey,
+                                 ServiceDescriptor serviceDescriptor,
+                                 ReferenceConfigBase<?> rc,
+                                 Object proxy,
                                  ServiceMetadata serviceMetadata,
                                  Map<String, AsyncMethodInfo> methodConfigs) {
         ConsumerModel consumerModel = new ConsumerModel(serviceMetadata.getServiceKey(), proxy, serviceDescriptor, rc,