Diverts not working - why ?
developer251 Dec 5, 2013 5:09 PMHi 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"/>
<durable>true</durable>
</jms-queue>
<jms-queue name="divert">
<entry name="java:/jms/queue/divert"/>
<entry name="java:jboss/exported/jms/queue/divert"/>
<durable>true</durable>
</jms-queue>
</jms-destinations>
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":
<diverts>
<divert name="route1">
<routing-name>route1</routing-name>
<address>divert</address>
<forwarding-address>test</forwarding-address>
<exclusive>true</exclusive>
</divert>
</diverts>
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 ?
Thanks
Max