JMS
- JMS stands for Java Message Service.
- JMS is a standard API for accessing enterprise messaging systems. Specifically, JMS:
- Enables Java applications sharing a messaging system to exchange messages
- Simplifies application development by providing a standard interface for creating, sending, and receiving messages.
Example:
If we have two Applications Like Application A and Application B.
- case 1:If the above two applications belongs to two different companies which are trying to communicate.
- case 2:If the two applications are from Different depatments in the same company
- case 3:If one application is developed in JAVA and other is developed in other technology
How the two applications are communicate with each other????
By using JMS Provider those two applications are communicated with each other by sending messages to one another as shown in the following diagram.
- Messages that are exchanged through JMS PRovider.JMS Provider is also known as Message server,Message Broker,MOM(Message Oriented Middleware).
- The Application which sends a message to JMS Provier is known as Message Producer where as which recieves the message is known as Message Consumer.
- Message consumer/producer and what ever is intereact with JMS Provider is known as JMS client.
JMS Provider
- With in JMS Provider we can create JMS destinations known as Queues and Topics.
- So the Message Producer can send message to a perticular destination(Queue/Topic) and Consumer can recieve message from a perticular Destination(Queue/Topic).
- A destination can have more than one producer/consumer.The main advantage of JMS architecture is like loosely coupled means the producer doent know who is going to recieve the message and the consumer doesnt know who will send the message.
JMS Messaging Models
we have two types of JMS Messeging models.
- Publish and subscribe Model
- Point To Point Model
1.Publish and Subscribe Model
- In this model Message Producer is known as Publisher and the Message Consumer is known as Subscriber.
- The destination we will use in this model is known as Topic.
- so when the Producer sends the message it will deliver to multiple subscribers as shown in the following figure.
2.Point To Point Model(P2P model)
- In this model Message Producer is known as sender and message Consumer is known as Reciever.
- The destination we will use in this model is Queue.
- so When the producer sends the message to the queue only a perticular reciever will going to be recieve the message even though we may register number of recievers as shown in the figure.
Reference:Ashiraj series..
No comments:
Post a Comment
test