This is an automated email from the ASF dual-hosted git repository. hengyunabc pushed a commit to branch revert_5710 in repository https://gitbox.apache.org/repos/asf/dubbo.git
commit 12dc2e06a2c2bdfdcfa2ed1fdf58aae8e67b70d4 Author: hengyunabc <hengyun...@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());