Hi All,
I'm trying to send a message using JMS from a servlet (running on Apache Tomcat) to ActiveMQ running in a different VM on the same system.
Things i have tried:
- Running ActiveMQ on my system.
- Wrote a client (Java app) (Producer) to create messages.
- Wrote a client (Java app) (Consumer) to receive those messages.
The above setup works fine.
Now, i have a servlet, which looks up the resources via JNDI. This is the configuration of context.xml in META-INF directory of Tomcat.
<Context>
<Resource
name="jms/ConnectionFactory"
auth="Container"
type="org.apache.activemq.ActiveMQConnectionFactory"
description="JMS Connection Factory"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
brokerURL=" tcp://localhost:61616"
/>
</Context>
I'm able to lookup these resources from the sevlet. The message is sent. But i think it is not reaching the ActiveMQ. Any ideas why ?
I feel it is sending it to some other destination vm://localhost
running within the container? which is not what i want. I'm new to MOM.
If someone could tell me how to send a JMS message from a servlet to a remote Broker, it would be great.