user123454321
user123454321

Reputation: 1058

JMS Durability and Persistence

I am currently reading about JMS and after a few articles, there is a little bit of confusion about durable subscription with non-persistent messages in my head. Let's start with: http://www2.sys-con.com/itsg/virtualcd/java/archives/0604/chappell/index.html - It says:

And another source: http://openmessaging.blogspot.com/2009/04/durable-messages-and-persistent.html says something totally different:

So, what is the truth :)?

Upvotes: 3

Views: 2480

Answers (2)

ravthiru
ravthiru

Reputation: 9623

With the Persistent messages, broker will save messages to disk, but depends on what kind of subscribers it has, if no durable subscribers then with some implementations, messages are deleted once delivered.

enter image description here

Upvotes: 7

Shashi
Shashi

Reputation: 15273

Generally speaking:

1) Non-persistent messages are not saved to disk. Hence they don't servive messaging provider restart.

2) On the other hand persistent messages are saved to disk. Hence they servive messaging provider restart.

Most messaging providers follow above concept. But as you pointed out there are some implementation specific deviations. For example IBM MQ has a concept of "Semi Persistent" message (NPMCLASS attribute). Although these are "Non Persistent" messages, they servive normal shutdown and restart of MQ messaging provider. If MQ ends abnormally, then "Semi Persistent" messages are lost.

So it boils down to implementation specifics.

Hope this helped.

Upvotes: 3

Related Questions