Java Message Service

 The Java Message Service is an API that allows applications to create,send,receive and read messages.It enables communication loosely coupled and Asynchronous i.e. JMS provider deliver message to a client as they arrive and also reliable in the sense that it delivers the message only once.

Parts of JMS Application
  • JMS Client: Programs that receive and send messages.
  • Non-JMS clients: Clients that use message system's native API instead of JMS.
  • Messages: Information that is used to communicate between its clients.
  • JMS Provider: MOM (Message Oriented Middleware) that implements JMS API
  • Administered Objects: Objects created by administrator for the use of clients. These are placed in JNDI namespace by an administrator. They are
    • ConnectionFactory: Object used by the clients to create connection with the provider
    • Destination: Object that client uses to specify the message source and the destination.
JMS Messaging Models
  • Point To Point model
In this model producer creates and sends the message that will be consumed by a single consumer.Message destination is called queue.There is no timing dependencies.The receiver acknowledges the successful processing of the message.


  • Publish/Subscribe Model
In this, the message created and send by the producer will be received by all the clients who have subscribed to that destination. Message destination is called Topic.This have timing dependencies and the consumer should be active to consume the message.

Comments

Popular posts from this blog

Transform values with a stream

Collections Framework

Inspect a collection