I'm trying to set up a jms queue on a standalone ActiveMQ that needs to be reachable across a the network. I'd appreciate your help.
This ActiveMQ provider is supposed to be running on a linux server.
I downloaded the activemq tar file (v 5.4.2) and installed it to the server with the following steps:
- untar-ed it,
- did minimal configuration to set ACTIVEMQ_BASE and ACTIVEMQ_HOME,
- then started it with the ./activemq start command from the command line
- checked <activemq-home>/data/activ
emq.log for the "INFO | .... started" line.
At this point, I *think* I have a activemq server up and running on this Linux machine.
I tried to use the following sample code (copied from the interweb) to send a message to the above jms server, but it just sit and hang:
ConnectionFactory connectionFactory =
Connection connection = connectionFactory.createConnection();
System.out.println("Trying to make connection");
Session session = connection.createSession(false,
Destination destination = session.createQueue("TESTQUEUE");
TextMessage message = session.createTextMessage("TEST MESSAGE");
System.out.println("Sent message '" + message.getText() + "'");
I tried the exact same code against an activemq server on my local machine, where ActiveMQ ConnectionFactory is initialized with "failover://tcp://localhos
t:61616", and the code executed fine.
But when i changed initialization to have the linux server's name "failover://tcp://<server-
6"; the code never made pass the
Here are a few of my questions to start (i have a whole lot of 'em):
1. Did I set up activeMQ right for it to be used the way I intend to use it?
2. If not, could you please point me to the right direction as to how to set it up right for the purpose?
3.If it is set up right, there must me something wrong with the way i'm trying to connect. what is the correct way to send a message?
I'm completely clueless in this area, no details is too small.
Thanks for your help.