Sunday, August 26, 2012

JMS

JMS (specification) stands for Java Messaging Service, which enables Java applications to send and receive messages to and from MoM (Message Oriented Middleware) in an Asynchronous fashion. It means the Receiver at the other end does not need to be present for the Sender to send the message, does not need to wait/check for Receiver to be running. If Receiver is running it means it is listening to the Destination. Destination could be Queue or Topic based upon the messaging model configuration Point to Point(PtP) or Publish/Subscribe (Pub/Sub) models.

PtP model: Upon message being published to the Queue by the Sender, out of N Receivers, it will be consumed by only one Receiver. It is like a race condition for the Receivers to grab that message.

Pub/Sub model: Upon message being published to the Topic by the Sender, all of N Receivers receive the same message. You can visualize it as a message Broadcasting setup.

Note: in model models Sender and Receivers must be registered to the Destinations

Messages are of 5 types that could be sent over in both models: Text, Map, Stream, Object and Byte

Applications of JMS: CRM systems, Inventory control systems, Search applications







No comments: