[jboss-user] [JBoss Remoting] - Re: Remote Client.addCallbackListener hang

Ron Sigal do-not-reply at jboss.com
Thu Apr 21 21:48:55 EDT 2011

Ron Sigal [http://community.jboss.org/people/ron_sigal] created the discussion

"Re: Remote Client.addCallbackListener hang"

To view the discussion, visit: http://community.jboss.org/message/601555#601555

Hi David,

I think you're on the right track.  BisocketClientInvoker.handleConnect() is waiting for a socket to use for the "control" connection.  In fact, it should already be there in the sockets Set.  When JBossMessaging sets up a connection, it calls org.jboss.remoting.Client.addListener(), which results in a call to BisocketClientInvoker.transport():

   protected Object transport(String sessionId, Object invocation, Map metadata,
                              Marshaller marshaller, UnMarshaller unmarshaller)
   throws IOException, ConnectionFailedException, ClassNotFoundException
      String listenerId = null;
      if (invocation instanceof InvocationRequest)
         InvocationRequest ir = (InvocationRequest) invocation;
         Object o = ir.getParameter();
         if (o instanceof InternalInvocation)
            InternalInvocation ii = (InternalInvocation) o;
            if (InternalInvocation.ADDLISTENER.equals(ii.getMethodName())
                && ir.getLocator() != null) // getLocator() == null for pull callbacks
               Map requestPayload = ir.getRequestPayload();
               listenerId = (String) requestPayload.get(Client.LISTENER_ID_KEY);
               listenerIdToClientInvokerMap.put(listenerId, this);
               BisocketServerInvoker callbackServerInvoker;
               callbackServerInvoker = BisocketServerInvoker.getBisocketServerInvoker(listenerId);
               callbackServerInvoker.createControlConnection(listenerId, true);

            // Rather than handle the REMOVELISTENER case symmetrically, it is
            // handled when a REMOVECLIENTLISTENER message is received by
            // BisocketServerInvoker.handleInternalInvocation().  The reason is that
            // if the Client executes removeListener() with disconnectTimeout == 0, 
            // no REMOVELISTENER message will be sent.

      return super.transport(sessionId, invocation, metadata, marshaller, unmarshaller);

In particular, the call to callbackServerInvoker.createControlConnection() creates the socket on the client side whose counterpart on the server side should land in the sockets Set.  For some reason, that isn't happening.  If you can nail that down, then you've got it.  

Thank you for letting me know about this issue.  Please let me know how your detective work goes, and let me know if you have any questions.


Reply to this message by going to Community

Start a new discussion in JBoss Remoting at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110421/fbbcde97/attachment-0001.html 

More information about the jboss-user mailing list