Skip to content

Commit

Permalink
Use the correct service name in the request package #6138
Browse files Browse the repository at this point in the history
  • Loading branch information
hengyunabc committed May 11, 2020
1 parent 5da840d commit 343f92d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
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;
Expand Down Expand Up @@ -168,7 +169,12 @@ protected void encodeRequestData(Channel channel, ObjectOutput out, Object data,
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());
Expand Down

0 comments on commit 343f92d

Please sign in to comment.