Difference Between Similar Terms and Objects

Difference Between Queue and Topic

Queue vs Topic

Java message service, or simply JMS, is a medium which sends messages to two or more clients. It permits contact between diverse mechanisms of a distributed application. This message-oriented middleware has two models which are the point-to-point model and publish or subscribe model. These two models have other names, too. The point-to-point model is also known as the queue model, and the publisher or subscriber model is also simply known as the topic model.

The queue or point-to-point model works by having a sender place messages to a queue, and the receiver will be able to read the messages from the queue. However, publisher or subscriber or the topic model works by disseminating messages by posting messages about a particular topic and having subscribers read them.

There are many differences between these two models which we will simply call “queue” and “topic.” In queue, the sender knows where the message will be going. There is a specific sender and a specific receiver, and there is the intention of being acknowledged as such. On the other hand, in topic you only have a publisher and a subscriber or subscribers. There is anonymity in the identity of both the publisher and subscriber.

Another main difference between the two is the number of recipients. In queue, you only have one receiver or consumer; unlike in topic where in you can have your message be disseminated to a number of subscribers. Also, in topic, the publisher has to be continuously active for a subscriber to receive the messages. Otherwise the message will be reallocated. In queue you do not have to worry about timing because the sender will have the luxury to send messages whenever he or she wants to. And the same goes for the receiver; he or she also has the liberty of reading it whenever he or she wants. In queue you will also be assured that as the sender you have successfully sent out your message because you will be notified by the receiver, but the same is not true for a topic system. There is even the risk of not having any subscribers.

SUMMARY:

1.The point-to-point or queue model works by the sender to receiver setup. On the other hand, publisher/subscriber or topic model works by bulletin setup.

2.In the queue model there is acknowledgement of the identity of the receiver and oftentimes the sender. In the topic model there is anonymity in the identities of both the subscriber and publisher.

3.Queue model is only allowed one recipient; topic, on the other hand, can have multiple recipients.

4.In queue model, the sender and receiver do not have to be both active at the same time. In the topic model, timing is very vital.

5.In the queue model, the sender will receive a notification when the message gets to the receiver. The topic model, on the other hand, will not notify you with such, and there is even a risk that you will have no subscribers.

Sharing is caring!


Search DifferenceBetween.net :




Email This Post Email This Post : If you like this article or our site. Please spread the word. Share it with your friends/family.


Leave a Response

Please note: comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

Articles on DifferenceBetween.net are general information, and are not intended to substitute for professional advice. The information is "AS IS", "WITH ALL FAULTS". User assumes all risk of use, damage, or injury. You agree that we have no liability for any damages.


See more about :
Protected by Copyscape Plagiarism Finder