-
1. Re: what is the correct format of "NonDurable"
jbertram Apr 7, 2013 10:48 PM (in response to ohmygod)The default "subscriptionDurability" is NonDurable.
If you set the "subscriptionDurability" to "Durable" (case sensitive) then it will be durable. Any other value means it will be NonDurable (which is why the two versions you used yield a NonDurable subscription).
-
2. Re: what is the correct format of "NonDurable"
ohmygod Apr 8, 2013 1:33 AM (in response to jbertram)Thanks Justin, so if I donot configure
propertyName = "subscriptionDurability"
, the default behaviour is NonDurable, right?And I read the hornetq user manual and it said the default is Durable. Could you please confirm for me about this?
http://docs.jboss.org/hornetq/2.3.0.CR1/docs/user-manual/html/perf-tuning.html
48.2. Tuning JMS Avoid durable messages. By default JMS messages are durable
-
3. Re: what is the correct format of "NonDurable"
jbertram Apr 8, 2013 9:23 AM (in response to ohmygod)Thanks Justin, so if I donot configure
propertyName = "subscriptionDurability"
, the default behaviour is NonDurable, right?That's correct. The default "subscriptionDurability" is NonDurable.
And I read the hornetq user manual and it said the default is Durable. Could you please confirm for me about this?
http://docs.jboss.org/hornetq/2.3.0.CR1/docs/user-manual/html/perf-tuning.html
48.2. Tuning JMS Avoid durable messages. By default JMS messages are durable
This is talking about the durability of the *messages*. It's not talking about the durability of subscriptions.
-
4. Re: what is the correct format of "NonDurable"
ohmygod Apr 8, 2013 9:37 AM (in response to jbertram)Thanks, then how to do this - avoid durable messages? Is it by configuring NonDurable subscriptionDurability or something else?
-
5. Re: what is the correct format of "NonDurable"
jbertram Apr 8, 2013 9:42 AM (in response to ohmygod)Configure your message producers not to send durable ("persistent" in JMS terms) messages. Whether or not the messages are durable has nothing to do with the durability of the subscription.
-
6. Re: what is the correct format of "NonDurable"
ataylor Apr 8, 2013 9:44 AM (in response to ohmygod)you set this on your producing client
i.e. producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-
7. Re: what is the correct format of "NonDurable"
ohmygod Apr 9, 2013 5:00 AM (in response to ataylor)Thanks both for the adivse. Then I have another question about the subscriptionDurability, will there be a better performance if donot configure subscriptionDurability (default NonDurable)?
And if you guys can explain more about the difference of the subscriptionDurability and the delivery mode, it will be much appreciated.
-
8. Re: what is the correct format of "NonDurable"
jbertram Apr 9, 2013 10:02 AM (in response to ohmygod)Thanks both for the adivse. Then I have another question about the subscriptionDurability, will there be a better performance if donot configure subscriptionDurability (default NonDurable)?
I don't think the performance will be any different.
And if you guys can explain more about the difference of the subscriptionDurability and the delivery mode, it will be much appreciated.
The "subscriptionDurability" activation configuration property refers to the durability of the subscription itself, not to the durability of the messages within it. A durable subscription is one that is present even when the subscriber is not connected (as opposed to a non-durable subscription which vanishes when the subscriber disconnects). You can read more about this in the JMS 1.1 specification (or one of the many explanations on the Internet).
The delivery mode of a producer refers to the intended durability of the message(s) which a producer sends. Messages can be either durable (i.e. persistent) or non-durable (i.e. non-persistent). Again, you can read more about this in the JMS 1.1 specification (or one of the many explanations on the Internet).
Both of these are basic JMS concepts explained in the specification.
-
9. Re: what is the correct format of "NonDurable"
jbertram Apr 9, 2013 3:56 PM (in response to jbertram)Regarding the performance of a durable vs. non-durable subscription...
Because of the ephemeral nature of a non-durable subscription, the messages it contains are never persisted to disk (even if they are sent with a persistent delivery-mode). Because of that, using a non-durable subscription may yield better performance.
-
10. Re: what is the correct format of "NonDurable"
ohmygod Apr 9, 2013 11:13 PM (in response to jbertram)Thanks for the detailed explanation. I have read about the subscriptionDurability and understand that if a jms message misses sending to the client because of some reasons, setting Durable subscriptionDurability can re-connect when it can be connected, and setting NonDurable subscriptionDurability will not be able to re-connect meaning this message will be missing. Is my understanding correct? If so, then using NonDurable may have some problems, right?
-
11. Re: what is the correct format of "NonDurable"
jbertram Apr 10, 2013 9:37 AM (in response to ohmygod)Thanks for the detailed explanation. I have read about the subscriptionDurability and understand that if a jms message misses sending to the client because of some reasons, setting Durable subscriptionDurability can re-connect when it can be connected, and setting NonDurable subscriptionDurability will not be able to re-connect meaning this message will be missing. Is my understanding correct?
Yes, I believe you're understanding is correct.
If so, then using NonDurable may have some problems, right?
There are no "problems" with a non-durable subscription, per se. The question is whether or not it fits your use-case.
-
12. Re: what is the correct format of "NonDurable"
ohmygod Apr 10, 2013 9:40 AM (in response to jbertram)Thanks. Then can you provide me a use-case that fits the NonDurable and Durable setting? Much appreciated.