You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by he...@apache.org on 2020/05/11 17:31:12 UTC
[dubbo] branch master updated: Use the correct service name in the
request package #6138
This is an automated email from the ASF dual-hosted git repository.
hengyunabc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new 343f92d Use the correct service name in the request package #6138
343f92d is described below
commit 343f92da4de3b6d8e7e1b50d08937c51a45fced1
Author: hengyunabc <he...@gmail.com>
AuthorDate: Mon May 11 19:42:07 2020 +0800
Use the correct service name in the request package #6138
---
.../main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java
index 7ef7f30..889f2ce 100644
--- a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java
+++ b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java
@@ -37,6 +37,7 @@ import java.io.IOException;
import java.io.InputStream;
import static org.apache.dubbo.common.constants.CommonConstants.DUBBO_VERSION_KEY;
+import static org.apache.dubbo.common.constants.CommonConstants.INTERFACE_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.PATH_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.VERSION_KEY;
import static org.apache.dubbo.rpc.protocol.dubbo.CallbackServiceCodec.encodeInvocationArgument;
@@ -168,7 +169,12 @@ public class DubboCodec extends ExchangeCodec {
RpcInvocation inv = (RpcInvocation) data;
out.writeUTF(version);
- out.writeUTF(inv.getAttachment(PATH_KEY));
+ // https://github.com/apache/dubbo/issues/6138
+ String serviceName = inv.getAttachment(INTERFACE_KEY);
+ if (serviceName == null) {
+ serviceName = inv.getAttachment(PATH_KEY);
+ }
+ out.writeUTF(serviceName);
out.writeUTF(inv.getAttachment(VERSION_KEY));
out.writeUTF(inv.getMethodName());