Posts

Showing posts from September, 2017

ActiveMQ message producer and consumer with durable subscriber example

Image
When I heard about JMS, it's something like having a message producer, a message broker (you can compare it with message media ) and a message consumer. It is very simple to understand the basic specification of jms. The figure will be explained well. JMS is nothing but a specification. But we have many providers like weblogic jms, ActiveMQ , hornetQ, RabbitMQ and much more. Here I used Apache ActiveMQ . It has many features and you can see it on their official website . Here I want to implement a message producer who produces message topic. And a durable subscriber consumes those messages. Using durable subscriber ensures that each and every message delivered to the consumers. Though a subscriber goes offline, a message stored in activemq context and when it will become online message delivered to the client. Internally it uses KahaDB (a file based persistence database) for message persistence. Now dive into the code. I used maven so here is the maven dependency ...