3 Replies Latest reply on Jan 17, 2011 8:52 PM by Vibul Imtarnasan

    Message Consumption Models

    Vibul Imtarnasan Newbie

      Hi,

       

      I'm new to HornetQ and would like confirmation if my understanding of HornetQ is correct.

       

      1. Implementing Point-To-Point

      • I create a queue with address "queue1" and name "queue1"
      • My message producers publish messages to address "queue1"
      • My message consumers (each on a different server/thread), consume messages from queue named "queue1".
      • Each Message will ONLY be delivered once  to a single consumer for processing

       

      2. Implementing Pub/Sub

      • For subscriber #1, I create a queue with address "subscribers" and name "subscriber1"
      • For subscriber #2, I create a queue with address "subscribers" and name "subscriber2"
      • For subscriber #3, I create a queue with address "subscribers" and name "subscriber3"
      • My message producers publish messages to address "subscribers"
      • My message consumer on subscriber #1, consume messages from queue named "subscriber1".
      • My message consumer on subscriber #2, consume messages from queue named "subscriber2".
      • My message consumer on subscriber #3, consume messages from queue named "subscriber3".
      • Messages will be delivered more than once to ALL subscribers; i.e. each messages will be copied into subscriber1, subscriber2 and subscriber3 queues

       

       

      Many Thanks

      Vibul

        • 1. Message Consumption Models
          Vibul Imtarnasan Newbie

          Hi,

           

          Can anyone on the core team help me out confirming if my understanding of HornetQ message consumption is correct?

           

          Thanks

          Veebs

          • 2. Message Consumption Models
            Clebert Suconic Master

            >Messages will be delivered more than once to ALL subscribers; i.e. each messages will be copied into subscriber1, subscriber2 and subscriber3 queues

             

             

             

             

            Copied is not really a good word here. The same message is delivered to multiple queues as references.

             

             

            Besides this it seems everything you said is correct. you can have more detail by looking at the docs.

            • 3. Message Consumption Models
              Vibul Imtarnasan Newbie

              Thanks very much Clebert.

               

              I must say that I've found HornetQ's documentation is great.  I've been able to very quickly embed it in my app and dynamically configure it.

               

              This is the only point that was not clear to me - how to implement pub/sub.

               

              I think a concrete code example would help. I could not find one in the existing samples.  I may have missed it but if there isn't one, would you like me to work on one and contribute to the project?

               

              Regards

              Veebs