0 Replies Latest reply on Feb 10, 2006 6:51 PM by stevech10

    JBoss JMS Remote Queue

    stevech10

      I have a web component that needs to send data to a remote queue. Both machines are running JBoss 4, but I cannot get the web client to communicate with the remote server, it always communicates with the local machine. I have setup the remote properties as follows in my web component:
      Properties properties = new Properties();
      properties.put(Context.INITIAL_CONTEXT_FACTORY,
      "org.jnp.interfaces.NamingContextFactory");
      properties.put(Context.URL_PKG_PREFIXES, "org.jboss.naming rg.jnp.interfaces");
      properties.put(Context.PROVIDER_URL, "jnp://server_url:1099");
      Context jndiContext = new InitialContext(properties);

      connectionFactory = (ConnectionFactory) jndiContext.lookup("java:comp/env/ConnectionFactory");
      destination = (Destination) jndiContext.lookup("queue/testQueue");
      connection = connectionFactory.createConnection();
      session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
      messageProducer = session.createProducer(destination);
      Queue tempQueue = session.createTemporaryQueue();
      MessageConsumer qReceiver = session.createConsumer(tempQueue);
      connection.start();
      ObjectMessage message = session.createObjectMessage(jmsObj);
      message.setJMSReplyTo(tempQueue);
      messageProducer.send(message);
      Message msg = qReceiver.receive(TIMEOUT);
      processMessage(msg);

      if both the web component and server component are located on the same machine, all is well, but when they are on separate machines the web component just times-out. There are no thrown exceptions, as i believe the web component is attached to the locahost queue instead of the remote server queue. I have not updated any of the JBoss xml files as I am using the pre-configured "ConnectionFactory" and "queue/testQueue".

      Any help would be greatly appreciated.