Difference between Point-To-Point and Publish/Subscribe JMS Messaging Models

JMS is an acronym Java message service. Java message service is an api which are provided by Java. It is used for implementing messaging system in your application.

JMS is an API or specification which does not contain implementation therefore to use JMS have to some third party service provider like ActiveMq , Weblogic messaging and etc.

JMS support two types of messaging domain −

  • Point to Point Messaging
  • Publish /Subscribe messaging  
Sr. No.KeyPoint to Point MessagingPublish /Subscribe
It is one to one destination of message. Message sent into the queue and that message can be read by only one receiver.
It is one to many messaging approach. Message sent to the topic and message can be received by multiple consumers
Pull /Push Mechanism
It used pull mechanism, client need to poll for the message every time  
It used push based model, message can be broadcast to all consumers
Acknowledgment is mandatory  
Acknowledgment is optional
Timing dependency
In PTP model, there is no timing dependency between sender and receiver.
There is a timing dependency between publishers and subscribers.