ActiveMQ is a popular library to use messaging via JMS.
There is a very good “Hello World” tutorial exists in offical site, I must say.
http://activemq.apache.org/hello-world.html
So I’m going to write another “Hello World” example with ActiveMQ, but I also show you how you can get statistics (enqueue/dequeue count etc.) in your code.
ActiveMQ architecture simply consist of a producer which sends messages to a broker and a consumer which listens that broker to receive messages. We will create a Queue on this broker to keep messages.