I have executed the hello world program as mentioned in the below link.. http://www.coderpanda.com/jms-example-using-apache-activemq/ Also, I have downloaded the ActiveMQ jar and related files as mentioned. I am able to compile and run the all the java files too. Noticed that the receiver java file compiles successfully but when the Receiver executes no output message gets generated on the console. The message sent to the queue is not getting retrieved. I can see that message count getting increased on UI of ActiveMQ on each hit(hosted on local host url) but the message put on the queue is not yet printed/retrieved. Can anyone suggest any other implementation for publisher subscriber, if any? Or your thoughts on JMS Q...
0
votes
check in ActiveMQ UI , if for the queue on which messages are increasing has an consumer attached i.e. the 'no of consumers' column, if it shows 0 when receiver is running, then it means your receiver is listening to wrong queue. If so check for a queue which has no of consumers greater than 0 , that might be the queue on which your receiver is listening
– Vihar
when i first run the Sender.java Class -->Name=SAMPLEQUEUE Number Of Pending Messages=0 Number Of Consumers=2 Messages Enqueued=1 Messages Dequeued=1
– yeppe
when I run the Receiver.java now then this is the status in ActiveMQ console Name=SAMPLEQUEUE Number Of Pending Messages=0 Number Of Consumers=3 Messages Enqueued=1 Messages Dequeued=1
– yeppe
How do I knw the receiver is listening to the wrong queue? Can that be seen through UI of ActiveMQ? if yes, How? as you can see I have entitled "SAMPLEQUEUE" as the queue name. And when i debug at this point "Message message = consumer.receive(); " the debug bar vanishes... seems like it is stuck at receive() function... any idea??
– yeppe
When you see a message dequed count increasing, then it is clear that message is successfully consumed by some consumer, and on running of your receiver, why did your consumer count increase in queue? Are there multiple instances? Or you haven't closed the connection properly
– Vihar
1 Answers
0
votes
The answer from Vihar is right.
When you see a message dequed count increasing, then it is clear that message is successfully consumed by some consumer, and on running of your receiver, why did your consumer count increase in queue? Are there multiple instances? Or you haven't closed the connection properly
I did not close the connection and consumers consumed the message in the queue whtn I ran the receive multiple times, I had no clue why and how it happened not until I ran it one at a time keeping a tab at the queue at the same time.