2 Replies Latest reply on Dec 6, 2013 4:34 AM by developer251

    Diverts not working - why ?


      Hi all HornetQ users,

      I'd need to use diverts in my application to route messages from one destination to another.


      My application is deployed on JBoss 7.2 which uses HornetQ 2.3.1 and contains two Queues:


                          <jms-queue name="test">

                              <entry name="java:/jms/queue/test"/>

                              <entry name="java:jboss/exported/jms/queue/test"/>



                          <jms-queue name="divert">

                              <entry name="java:/jms/queue/divert"/>

                              <entry name="java:jboss/exported/jms/queue/divert"/>





      I have also an MDB which is bound on the test queue:

      @MessageDriven(name = "QueueMDB", activationConfig = {

              @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),

              @ActivationConfigProperty(propertyName = "destination", propertyValue = "java:/jms/queue/test"),

              @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge") })

      public class QueueMDB implements MessageListener { ...


      Now I'm sending messages using a JMS client to the queue named "divert" and expect, with the following definition to have my messages consumed by the MDB bound to the queue "test":



                          <divert name="route1">








      Unfortunately, I can see that messages are not routed and just stay on the divert destination, not consumed by the MDB.

      Is there something wrong in my configuration? maybe MDB are not able to receive message using Diverts ?




        • 1. Re: Diverts not working - why ?

          Is there something wrong in my configuration?

          Yes, I believe there is something wrong in your configuration.  Try using this for your divert:


                              <divert name="route1">







          When using "core" artifacts (like diverts) on JMS artifacts (like jms-queue) you have to keep in mind how the JMS-to-core mapping works.  See http://docs.jboss.org/hornetq/2.3.0.Final/docs/user-manual/html/jms-core-mapping.html for more details.

          • 2. Re: Diverts not working - why ?

            Thanks it works- it is a bit misleading that the WildFly Administration console "suggests" the name without the correct HornetQ mapping (in my case "divert" and "test"). However now it works! Thanks!