1 Reply Latest reply on Dec 27, 2005 11:40 AM by Tim Fox

    multiplex configuration

    Tom Elrod Master

      This thread is for discussing the configuration and setup for multiplex invoker (with push callbacks in particular). After looking at the doc at http://labs.jboss.com/portal/jbossremoting/docs/guide/ch04.html#d0e764 and the multiplex client same (org.jboss.remoting.samples.multiplex.MultiplexInvokerClient), have one initial concern, which is if callback servers are tied to a one to one mapping between target server and callback server?

      So, if take the example config from the docs:

       String locatorURI = "multiplex://serverhost.com:9090/?callbackHost=clienthost.com&callbackPort=8080";
       InvokerLocator locator = new InvokerLocator(locatorURI);
       client = new Client(locator, "subsystem");
      
       connector = new Connector();
       locatorURI = "multiplex://clienthost.com:8080/?serverSocketConnectHost=serverhost.com&serverSocketConnectPort=9090";
       locator = new InvokerLocator(locatorURI);
       connector.setInvokerLocator(locator.getLocatorURI());
       connector.create();
       connector.start();
      


      The callback server connector can not receive callbacks from any other target servers (only serverhost.com:9090)? I am not sure how big of a deal this is, but would be nice if could just create one callback connector to be used for all the target server callbacks. Sorry Ron, I missed this earlier. Tim, is this going to cause any problems for you?



        • 1. Re: multiplex configuration
          Tim Fox Master

          I have no problems with the callback server not being able to receive callbacks from other servers.

          I have been trying to work out how to configure the multiplex transport for jboss messaging and I have to admit I'm still a bit confused since there seem to be so many different ways it can be configured.

          For the JMS scenario, we want the following:

          Each JMS connection to map to one multiplex connection using it's own unique physical tcp connection.

          Each JMS connection to be able to receive callbacks along the same tcp connection.

          So far, I believe that can be configured in the following way:

          1) Firstly on the jms server I start a connector:

          Connector connector = new Connector();
          InvokerLocator locator = new InvokerLocator("multiplex://jms-server:9090");
          connector.setInvokerLocator(locator.getLocatorURI());
          connector.create();
          handler = new JBossMessagingInvocationHandler();
          connector.addInvocationHandler("JMS", handler);
          connector.start();

          2) On the jms client, when a new JMS connection is created I need to do two things:

          a) Create a client that will be used for the jms client --> jms server synchronous invocations:

          String locatorURI = "multiplex://jms-server:9090/?clientMultiplexId=connection1";
          InvokerLocator locator = new InvokerLocator(locatorURI);
          Client client = new Client(locator);

          This will cause a multiplex connection to be created on a physical tcp connection from jms-client to jms-server.

          I have added the parameter clientMultiplexId to identify this connection so that it can specified when creating the callback server so it knows to use the same multiplex connection for the callback server.

          b) Create a callback server utilising the same multiplex connection created in a):

          connector = new Connector();
          String locatorURI = "multiplex://jms-client:xyz/?serverMultiplexId=connection1";
          InvokerLocator locator = new InvokerLocator(locatorURI);
          connector.setInvokerLocator(locator.getLocatorURI());
          connector.create();
          connector.start();

          This will create a virtualserverinvoker on the client, utilising the same multiplex connection.

          (Question: What port do I specify in xyz? Does this represent a real port? If I don't care can this be auto-allocated?)

          Does that sound about right? Or I am I missing something here?