Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix thrift protocol, use path to locate exporter. #3331

Merged
merged 2 commits into from
Jan 25, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ private Object decode(TProtocol protocol)

// version
String serviceName;
String path;
long id;

TMessage message;
Expand All @@ -171,6 +172,7 @@ private Object decode(TProtocol protocol)
protocol.readI16();
protocol.readByte();
serviceName = protocol.readString();
path = protocol.readString();
id = protocol.readI64();
message = protocol.readMessageBegin();
} catch (TException e) {
Expand All @@ -181,6 +183,7 @@ private Object decode(TProtocol protocol)

RpcInvocation result = new RpcInvocation();
result.setAttachment(Constants.INTERFACE_KEY, serviceName);
result.setAttachment(Constants.PATH_KEY, path);
result.setMethodName(message.name);

String argsClassName = ExtensionLoader.getExtensionLoader(ClassNameGenerator.class)
Expand Down Expand Up @@ -496,6 +499,8 @@ private void encodeRequest(Channel channel, ChannelBuffer buffer, Request reques
protocol.writeByte(VERSION);
// service name
protocol.writeString(serviceName);
// path
protocol.writeString(inv.getAttachment(Constants.PATH_KEY));
chickenlj marked this conversation as resolved.
Show resolved Hide resolved
// dubbo request id
protocol.writeI64(request.getId());
protocol.getTransport().flush();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ public CompletableFuture<Object> reply(ExchangeChannel channel, Object msg) thro

if (msg instanceof Invocation) {
Invocation inv = (Invocation) msg;
String serviceName = inv.getAttachments().get(Constants.INTERFACE_KEY);
String path = inv.getAttachments().get(Constants.PATH_KEY);
chickenlj marked this conversation as resolved.
Show resolved Hide resolved
String serviceKey = serviceKey(channel.getLocalAddress().getPort(),
serviceName, null, null);
path, null, null);
DubboExporter<?> exporter = (DubboExporter<?>) exporterMap.get(serviceKey);
if (exporter == null) {
throw new RemotingException(channel,
Expand Down