Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

why not durable subscriber on queue, and more?  RSS feed

Yan Zhou
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I'd like to know why durable subscription only applies to topic, not queue. The following is my reasoning,

there is only one consumer on the queue. If it is inactive, whether he gets msg. depends on whether the JMS provider uses a persistent store. If it does, the messages are always delivered when the listener reconnects later, otherwise it is lost. So the concept of durable subscriber does not make sense for queue.

But with topic, there is more than one subscriber. A subscriber may indicate that he does not care if the msg. is not delivered when the subscriber is inactive. Allowing nondurable subscribers allow a better performance as the messsages are not kept. But I wonder how much performance gain, though? After all, the message is already stored, and the only performance saving I can think of is to look it up in database, and some administrative type of work. It does need to remove the message, but that needs to be done anyway.

In addition, in a situation where several MDB subscribe to a topic, and both the beans and JMS provider run on the same app. server instance, I do not see why we would need durable subscriptions. Because the only reason for a consumer to become inactive is a server crash, in that case, client cannot even send messages to begin with. Did I miss anything here? (If MDB throws an exception, does that make it inactive? Or would the app. server remove the instance and create one immediately?)

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