Solved

JMS Difference Between Queue and Durable Topic

Posted on 2010-11-29
2
1,439 Views
Last Modified: 2013-11-15
I'm trying to figure out the difference between a Durable Topic and a Queue in JMS.

At the surface, queues and topics differ in that a queue has 1 consumer but topics can have 0,1 or n consumers.

I think that's where the differences end - but not really in this case because a durable topic can have only one active subscriber at a time ( http://download.oracle.com/javaee/5/tutorial/doc/bncfu.html ).

To my understanding, messages in a queue are persisted until they are consumed.  Same with a durable topic.  For both, a  Queue and Durable Topic the consuming process does not have to be running when messages are produced and the messages will be delivered when the consumer is brought up.

0
Comment
Question by:sevzas
2 Comments
 
LVL 13

Accepted Solution

by:
Bart Cremers earned 500 total points
ID: 34234017
A queue saves a message until one consumer arrives and then delivers the message to that single consumer. Even when more consumers exist, only one will get it.

A durable topic saves messages for all registered subscribers. This means that one a new consumer arrives, it will register itself using a unique name. The topic assures that every subscriber to the topic will receive every message that it gets, even if a subscriber is not online.
0
 

Author Closing Comment

by:sevzas
ID: 34238222
Good answer! Thanks!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video demonstrates how to use each tool, their shortcuts, where and when to use them, and how to use the keyboard to improve workflow.
The viewer will learn how to implement Singleton Design Pattern in Java.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question