Java Messaging Service is an API Specification that supports the formal communication known as messaging between computers in a network. According to the JMS messaging standard JMS allows Java EE applications to create, send, receive, and consume messages in a loosely coupled, reliable, and asynchronous way.
By using JMS an application can communicate with any number of application. The communications are loosely coupled. Because the applications needed to communication are not directly connected to each other means those applications are connected to a common destination. An application can send the messages to the destination and take the messages from the same destination.
Also there is no timing dependency between producer and consumer in JMS. But we can make message transfer in a synchronize way on the basis of time dependencies between the clients
JMS API Architecture
JMS Application composed of following parts
JMS Provider or Service Provider - Which is a messaging system that implements JMS interfaces. Now a days there are various JMS providers are available like Open JMS, JBoss Messaging, Apache Active MQ and so on.
JMS Client - Are the program or component which written in java are produce or consume messages
Messages - Messages are the objects which communicate between clients.
Administered Objects - Which are preconfigured object created by an administrator for the use of clients. There are two types of administrated objects which are Connection Factory and Destination.
Connection factory- It is an administered object with which a connection between JMS client and Service provider is establishing.
Destination - Destination is the object into which a JMS client targets its messages. Also the JMS client receives messages from the destination. And hence the JMS system is loosely coupled .
Native Clients - Programs that uses a messaging products native client API instead of JMS API.
JMS API Models
The JMS API supports two models:
Point to Point Approaches (Queue)
The point to pint approach consists of n number of Producers (or only one) , Only one consumer and a queue.Each message is addressed to a specific queue.Receiving clients can took the messages from the queue.
Publish-Subscribe Messaging Approaches (Topic)
In this approach there can be multiple publishers as well as multiple consumers. A publisher can have multiple consumers . The system is taking care to do the correct delivery.In this approach publishers and consumers have timing dependencies.Suppose a client is subscribed to a topic. It can only consume messages published after the subscription has created.
No comments:
Post a Comment