4 Replies Latest reply on Nov 26, 2012 10:26 AM by jbertram

    Arbitrary destination addresses and predicate based subscribers

    metula

      I note that AMQP is on the roadmap for HornetQ so the answer to this question is probably 'not yet but soon'.  I have seen other JMS providers with this 'enhanced' functionality in their JMS products though.

       

      Does HornetQ support (using JMS) the sending of messages to arbitrary topics (i.e. undefined in the configuration) and direct delivery to any subscriber with a matching subscription?

       

      I see some routing functionality in the documentation but it seems like all of the topics must be explicitally configured

       

      For example, I could have (possibly durable) subscribers with the following destination addresses: 

       

      1. jms.topic.event.*

      2. jms.topic.event.order.*

      3. jms.topic.*.order

      3. jms.topic.other.address.*

       

      If a process were then to send a message to the address jms.topic.event.order.create then subscribers 1, 2 and 3 would receive the message

        • 1. Re: Arbitrary destination addresses and predicate based subscribers
          jbertram

          I think what you're looking for is called a "topic hierarchy" (at least in our documentation).  Look at the <HORNETQ_HOME>/examples/jms/topic-hierarchies example and also read this

           

          Does that fit your need?

           

          BTW, I'm not sure what this has to do with AMQP.  Can you clarify?

          • 2. Re: Arbitrary destination addresses and predicate based subscribers
            metula

            If I understand correctly, Topic Hierarchies allow us to create a queue (subscriber), for example queue.event.# which will receive messages sent to queue.event.abc, queue.event.abc.def and so on - but these queues must be pre-defined.

             

            The reason I mention AMQP is because the sort of message routing I'm looking for is native to the AMQP architecture of message exchanges, routing keys, bindings etc.

            • 3. Re: Arbitrary destination addresses and predicate based subscribers
              jbertram

              If I understand correctly, Topic Hierarchies allow us to create a queue (subscriber), for example queue.event.# which will receive messages sent to queue.event.abc, queue.event.abc.def and so on - but these queues must be pre-defined.

              That's correct.

               

               

              The reason I mention AMQP is because the sort of message routing I'm looking for is native to the AMQP architecture of message exchanges, routing keys, bindings etc.

              Understood.  JMS doesn't define anything like this.

              • 4. Re: Arbitrary destination addresses and predicate based subscribers
                jbertram

                You originally asked about JMS, but I do believe you could do this with the HornetQ Core API.  I think you should be able to use org.hornetq.api.core.client.ClientSession.createQueue(SimpleString. SimpleString) to create the queues you want bound to the addresses you want dynamically.