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.URL_PKG_PREFIXES, "org.jboss.naming rg.jnp.interfaces");
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);
ObjectMessage message = session.createObjectMessage(jmsObj);
Message msg = qReceiver.receive(TIMEOUT);
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.