Differences between Point to Point Messaging Model and Publish Subscribe Messaging Model is explained in this article. Point to Point Messaging Model and Publish Subscribe Messaging Model are the two different messaging paradigms supported by Java Message Service (JMS). These messaging paradigms are programming models that support asynchronous way of messaging between diverse systems.
Listed below are the differences between Point to Point Messaging Model and Publish Subscribe Messaging Model is explained in this article. Point to Point Messaging Model and Publish Subscribe Messaging Model:
Point to Point Messaging Model |
Publish Subscribe Messaging Model |
JMS Destination is Queue |
JMS Destination is Topic |
JMS Producer is called as Sender |
JMS Producer is referred as Publisher |
JMS Consumer is called as Receiver |
JMS Consumer is referred as Subscriber |
In Point to Point Messaging Model, message can be received by only one JMS Consumer |
In Publish Subscribe Messaging Model, a message can be received by several JMS Consumers |
There is no time dependency laid for the receiver to receive the message. If in case the receiver is unavailable to receive the message at any point of time, then queue will store the message until receiver is ready to receive it |
There is a time dependency that is laid between the Producer and Consumer in Publish Subscribe Messaging Model |
When the Consumer receives the message, it will send an acknowledgement back to the Producer |
No acknowledgement is sent by the Consumers when they receive the message |
There is no further classification of Point to Point Messaging Model |
Publish Subscribe Messaging Model is further classified into Persistent Messaging Model and Non-Persistent Messaging Model. In Persistent Messaging Model, messages are stored in the JMS Server until there are delivered to the Destination, but in Non-Persistent Messaging Model, there is no intermediate storage option |
Point to Point Messaging Model contains four possible architectures namely:
In all these possible architectures, a Producer has a limitation to send a message to only one Consumer. This is because, Point to Point Messaging Model enforces one to one relationship between the Producer and Consumer |
Publish Subscribe Messaging Model contains only three possible architectures namely:
In all these possible architectures, Producer has the leverage to send a message to one or more (many) Consumers. This is because, Publish Subscribe Messaging Model enforces one to many relationship between the Producer and Consumer |