Skip to content

Commit

Permalink
fix stubevent can't work (apache#9825)
Browse files Browse the repository at this point in the history
  • Loading branch information
xxxcrel committed Mar 23, 2022
1 parent da4f5f2 commit 1222676
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -239,13 +239,14 @@ Invoker<?> getInvoker(Channel channel, Invocation inv) throws RemotingException
int port = channel.getLocalAddress().getPort();
String path = (String) inv.getObjectAttachments().get(PATH_KEY);

// if it's callback service on client side
//if it's stub service on client side(after enable stubevent, usually is set up onconnect or ondisconnect method)
isStubServiceInvoke = Boolean.TRUE.toString().equals(inv.getObjectAttachments().get(STUB_EVENT_KEY));
if (isStubServiceInvoke) {
port = channel.getRemoteAddress().getPort();
//when a stub service export to local, it usually can't be exposed to port
port = 0;
}

//callback
// if it's callback service on client side
isCallBackServiceInvoke = isClientSide(channel) && !isStubServiceInvoke;
if (isCallBackServiceInvoke) {
path += "." + inv.getObjectAttachments().get(CALLBACK_SERVICE_KEY);
Expand Down

0 comments on commit 1222676

Please sign in to comment.