3 Replies Latest reply on Oct 8, 2011 4:48 PM by everjava

    access queue from different servers

    everjava

      I would like to know if is possible to access a jms queue of a jboss running on server A from an application running on server B. The server A and B are different machines. I'm using jboss 5.1 and jbossremoting 2.5.1

      If is possible, how can I do that ?

      thanks!

        • 1. Re: access queue from different servers
          gaohoward

          You can use JNDI.

          • 2. Re: access queue from different servers
            everjava

            Hi, thanks to reply...

             

            but how can I do that using message drive bean deployed on server A listening messages from server B ?

             

            @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue") ,

                                                @ActivationConfigProperty(propertyName="destination", propertyValue="queue/EversonQueue") },

             

            mappedName = "queue/EversonQueue")

            public class MyMDB implements MessageListener {

            • 3. Re: access queue from different servers
              everjava

              i solved as below

               

              send from server A

              Properties jndiProps = new Properties();
              jndiProps.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
              jndiProps.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
              jndiProps.put(Context.PROVIDER_URL, "jnp://1.1.1.1:1099";
              InitialContext initialContext = new InitialContext(jndiProps);

               

              server B(1.1.1.1)

              Message drive bean