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


The following commit(s) were added to refs/heads/3.0-multi-instances by this 
push:
     new 23739c2  Fix ut
23739c2 is described below

commit 23739c2afa73b0a4038e333574d2edaef0c3b8c8
Author: Albumen Kevin <[email protected]>
AuthorDate: Tue Aug 31 09:57:46 2021 +0800

    Fix ut
---
 .../java/org/apache/dubbo/rpc/protocol/grpc/GrpcProtocol.java     | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/dubbo-rpc/dubbo-rpc-grpc/src/main/java/org/apache/dubbo/rpc/protocol/grpc/GrpcProtocol.java
 
b/dubbo-rpc/dubbo-rpc-grpc/src/main/java/org/apache/dubbo/rpc/protocol/grpc/GrpcProtocol.java
index 39b15a0..bbcbfe1 100644
--- 
a/dubbo-rpc/dubbo-rpc-grpc/src/main/java/org/apache/dubbo/rpc/protocol/grpc/GrpcProtocol.java
+++ 
b/dubbo-rpc/dubbo-rpc-grpc/src/main/java/org/apache/dubbo/rpc/protocol/grpc/GrpcProtocol.java
@@ -120,11 +120,17 @@ public class GrpcProtocol extends AbstractProxyProtocol {
 
         // CallOptions
         try {
+            ReferenceConfigBase<?> referenceConfig;
+            if (url.getServiceModel() != null) {
+                referenceConfig = url.getServiceModel().getReferenceConfig();
+            } else {
+                referenceConfig = 
ApplicationModel.getConsumerModel(url.getServiceKey()).getReferenceConfig();
+            }
             @SuppressWarnings("unchecked") final T stub = (T) 
dubboStubMethod.invoke(null,
                     channel,
                     GrpcOptionsUtils.buildCallOptions(url),
                     url,
-                    url.getServiceModel().getReferenceConfig()
+                    referenceConfig
             );
             final Invoker<T> target = proxyFactory.getInvoker(stub, type, url);
             GrpcInvoker<T> grpcInvoker = new GrpcInvoker<>(type, url, target, 
channel);

Reply via email to