1 Reply Latest reply on Nov 12, 2003 10:27 PM by adrian.brock

    Remote Messaging : few questions

    computerrobot

      Hi,
      I wanted to discuss and figure out how to do remote messaging from standard MBeans within JBoss (no EJB's or MDB or anything). I am using JBoss 3.2.2RC4.

      Suppose there are 2 machines running JBoss. 1 will act as server and other as client.

      These are the ways I can think of for clients to publish messages to server

      1.
      ----
      inside the code of clients:

      Hashtable props = new Hashtable();
      ....
      ("java.naming.provider.url", "jnp://servername:1099");
      InitialContext iniCtx = new InitialContext(props);
      Object tmp = iniCtx.lookup("XAConnectionFactory");
      ----


      2.
      -----
      In Sun's J2EE tutorial, they talk about creation a ConnectionFactory that's mapped to a remote machine, so in the code of the client, they just look up ConnectionFactory locally and remoting is handled behind the scene. After searching these forums, I found something similar, but I can't seem to gather all the pieces of puzzle. This is what I think...

      Step 1:

      Update deploy/jms/jms-ds.xml with this information:


      RemoteJMSProvider

      org.jboss.jms.jndi.JBossMQProvider

      servermachine:1099
      XAConnectionFactory
      XAConnectionFactory


      This is where the confusion starts. What do I need to do after this in config files and then how do I access it from code. For example,do I need to update standardjboss.xml with :
      <destination-jndi-name>whatToPutHere!</destination-jndi-name>
      -----

      Any help will be much appreciated.

        • 1. Re: Remote Messaging : few questions

          You only have part of the solution.

          You also want to deploy a connection factory that
          uses the remote provider, similar to JmsXA in jms-ds.xml

          I'm pretty sure there is an example somewhere.
          The key is to add <config-property name="JmsProviderJNDIName">RemoteMQProvider</config-property>

          Check the jms rar for the exact name of the property.

          Regards,
          Adrian