12 Replies Latest reply on Apr 10, 2013 9:40 AM by ohmygod

    what is the correct format of "NonDurable"

    ohmygod

      what is the correct format of "NonDurable"? I tested "non-durable" and "NonDurable" and seemed they are both working. 

       

      @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "non-durable")
      

       

      And what is the default value, if I donot set propertyName = "subscriptionDurability".

        • 1. Re: what is the correct format of "NonDurable"
          jbertram

          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

            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

              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

                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

                  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

                    you set this on your producing client

                     

                    i.e.  producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);

                    • 7. Re: what is the correct format of "NonDurable"
                      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)?

                       

                      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

                        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

                          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

                            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

                              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

                                Thanks. Then can you provide me a use-case that fits the NonDurable and Durable setting? Much appreciated.