Skip to content

Commit

Permalink
fix stubevent can't work (apache#9825)
Browse files Browse the repository at this point in the history
fix apache#9824

(cherry picked from commit 1222676)
  • Loading branch information
xxxcrel authored and BurningCN committed Mar 28, 2022
1 parent 14a3ad3 commit 05360d4
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -250,13 +250,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 05360d4

Please sign in to comment.