10 Replies Latest reply on Sep 11, 2008 11:29 PM by jbossnoob

    Distributed queue, HA-JMS/singleton basic questions

    kapucin

      Hello
      Could someone, please, explain what's the advantage of using HA-singleton vs Distributed queue (DQ)?
      Is HA-singleton simply the old way for providing the fail-over functionality, and should not be used as DQ is better?
      Is the difference only in JMS implementation (JBM vs JBossMQ)?
      Can JBM be configured for ha-singleton, although it seems to defeat the purpose of DQ?
      How does the performance compare of distributed queue vs HA-JMS?

      I didn't seem to find the answers in the documentation, or might have missed simple facts, so I'd appreciate if you point me in the right direction or answer my questions.

      Thanks in advance.

        • 1. Re: Distributed queue, HA-JMS/singleton basic questions
          timfox

          Hello kapucin - comments inline

          "kapucin" wrote:
          Hello
          Could someone, please, explain what's the advantage of using HA-singleton vs Distributed queue (DQ)?
          Is HA-singleton simply the old way for providing the fail-over functionality, and should not be used as DQ is better?


          JBoss MQ ia really a single server JMS server - i.e. it only ever has one node active in the cluster at any one time. This differs with JBM where all nodes are active.

          HA singleton was primarily designed of getting the single server JBoss MQ to work in the cluster - it handles automatically starting up a new instance if failure occurs.

          JBoss Messaging was designed to have true clustering so HA singleton is not necessary.



          Can JBM be configured for ha-singleton, although it seems to defeat the purpose of DQ?



          JBoss Messaging never needs to be configured for HA singleton.

          However there is one case where singletons are useful - this is the case where you want to guarantee that your messages are consumed sequentially from a single queue.

          This can be accomplished by setting the attribute "singleton" on the connection factory. JBM will then ensure that the cf is only bound in JNDI on one server in the cluster at any one time.

          If you then use HA JNDI to lookup the connection factory. HA JNDI will ensure you pick up the cf from the correct node.

          You can then create your producers/consumers on that node, or deploy MDBs across the cluster using the Singleton MDB profile and this will give you singleton functionality.

          You also get transparent failover with this for free, which you don't get with JBoss MQ.

          This is new functionality I have only just added as a response to a last requirement from EAP, so it will only be available from 1.4.0.SP2 and onwards.

          • 2. Re: Distributed queue, HA-JMS/singleton basic questions
            kapucin

            That explains it.
            Thank you.

            • 3. Re: Distributed queue, HA-JMS/singleton basic questions
              timfox

              Sorry my last post got a bit munged - I just re-edited it

              • 4. Re: Distributed queue, HA-JMS/singleton basic questions
                kapucin

                I see.
                One question on fault-tolerange to message loss. Do the messages get replicated across the cluster (using post-office pulling or post-office routing?), so in case a node fails, they are not lost OR are they stored in a database until acknowledged?
                If it's the database, then I can assume that not persisted messages are lost in case of node failure.
                If it's replication, how does it affect the performance in term of network traffic/resource usage? Are all the messages forwarded/pulled by all the members or only those unread for a # of milliseconds and only a limited number of nodes?


                • 5. Re: Distributed queue, HA-JMS/singleton basic questions
                  timfox

                   

                  "kapucin" wrote:

                  One question on fault-tolerange to message loss. Do the messages get replicated across the cluster (using post-office pulling or post-office routing?), so in case a node fails, they are not lost OR are they stored in a database until acknowledged?

                  Persistent messages are pulled. Non persistent are routed


                  If it's the database, then I can assume that not persisted messages are lost in case of node failure.


                  Only persistent messages are guaranteed to survive failure. JMS non persistent messages were created to be transient messages that you should only use if you can cope with message loss.


                  If it's replication, how does it affect the performance in term of network traffic/resource usage? Are all the messages forwarded/pulled by all the members or only those unread for a # of milliseconds and only a limited number of nodes?


                  Can you be more specific in your question? Seems like there's twenty questions there rolled into one question-ball ;)




                  • 6. Re: Distributed queue, HA-JMS/singleton basic questions
                    kapucin

                    Our system may produce a large number of messages. What I'm concerned about is that the data volume on a node would multiply depending on the number of peer nodes pulling/pushing.
                    Most of the time there will be at least one consumer on each queue. So there is no need to route/pull the messages until a consumer starts to choke or fails completely. Of course, if my assumptions on how it works are correct.

                    So, are the messages routed/pulled regardless of the state of a receiving queue or there are conditions that trigger routing/pulling?

                    If there are conditions, what are those?




                    • 7. Re: Distributed queue, HA-JMS/singleton basic questions
                      timfox

                       

                      "kapucin" wrote:

                      Most of the time there will be at least one consumer on each queue. So there is no need to route/pull the messages until a consumer starts to choke or fails completely. Of course, if my assumptions on how it works are correct.


                      That's right - JBM always tries the local consumer (if any) first - only if the local consumer is busy or non existent will it consider letting a remote consumer consume it.

                      So if you have at least one consumer on each node and they are never choking then no messages should get redistributed between nodes.

                      • 8. Re: Distributed queue, HA-JMS/singleton basic questions
                        kapucin

                        Great.

                        Much appreciated.

                        • 9. Re: Distributed queue, HA-JMS/singleton basic questions
                          jbossnoob

                          So do I take it that this will not really work?

                          https://jira.jboss.org/jira/browse/JBMESSAGING-1149

                          • 10. Re: Distributed queue, HA-JMS/singleton basic questions
                            jbossnoob

                            Hello Hello, noob here, I need to know if this works thanks?

                            The JIRA looks like it doesn't and if it doesn't how can I do it. If it is not possible I need to revert back to JBoss MQ which would really suck :(