• Post Reply Bookmark Topic Watch Topic
  • New Topic

JMS Durable/Non-Durable & Persistent/Non-Persistent  RSS feed

 
Vaibhav Gargs
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am new to JMS and having few confusions regarding durable/non-durable & persistent/non-persistent concepts, below are my queries:

1. Why we have durable concept only in case of topics and not applicable to queues?

2. Persistent/Non-persistent is applicable to both queues & topics?

3. What is the meaning of persistent + durable in case of topics? Isn't it redundant to have persistent as well as durable? If we just have persistent, won't it work fine? Why do we need durable really?

Please share your inputs.

Thanks.
 
Henry Wong
author
Sheriff
Posts: 23028
120
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vaibhav Gargs wrote:
1. Why we have durable concept only in case of topics and not applicable to queues?


Durability is about the state of the subscriber. There is a concept of durable sources (aka publisher) as well, but JMS doesn't support it.... oh well....

Basically, when a durable subscriber leaves, and then later comes back -- the broker is responsible for negotiating where it last left off, so that it can get as close as possible to when the subscriber left.

As for queues, this state isn't really important right?  If the consumer leaves, the messages that it took would eventually time out and get reassigned. And when the consumer returns, it just join the group of consumers, and get new messages.

Vaibhav Gargs wrote:
2. Persistent/Non-persistent is applicable to both queues & topics?


Persistent messages will, of course, survive a broker restart. Also, there is generally more disk than memory, so the broker can hold more messages.... and this applies to both topics and queues.

Vaibhav Gargs wrote:
3. What is the meaning of persistent + durable in case of topics? Isn't it redundant to have persistent as well as durable? If we just have persistent, won't it work fine? Why do we need durable really?


Well, technically, durability and persistence are configured together... or they should be. I don't know if that makes it redundant though.

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!