-
15. Re: Re: Multiple DLQs in HornetQ
sankalp.madaan Apr 16, 2014 6:55 AM (in response to jbertram)Yes I understand now about DLAs. But I am getting null while using _HQ_ORIG_QUEUE property. And it is very important for me to determine which subscriber failed. Can I have any way out?
Here are the details of my MDB.
@MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"), @ActivationConfigProperty(propertyName = "destination", propertyValue = "/topic/NORSTopic"), @ActivationConfigProperty(propertyName = "user", propertyValue = "user"), @ActivationConfigProperty(propertyName = "password", propertyValue = "password"), @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"), @ActivationConfigProperty(propertyName = "clientID", propertyValue = "Durable-Sub"), @ActivationConfigProperty(propertyName = "connectorClassName", propertyValue = "org.hornetq.core.remoting.impl.netty.NettyConnectorFactory"), @ActivationConfigProperty(propertyName = "connectionParameters", propertyValue = "host=localhost;port=5445"), @ActivationConfigProperty(propertyName = "subscriptionName",propertyValue = "client1"), })
-
16. Re: Re: Multiple DLQs in HornetQ
jbertram Apr 15, 2014 10:30 AM (in response to sankalp.madaan)From what I can see in org.hornetq.tests.integration.client.DeadLetterAddressTest.testBasicSend() in the HornetQ test-suite the "_HQ_ORIG_QUEUE" property should have the name of the queue (i.e. subscription) where the message was originally sent. If you're not seeing that then I would need a test of some kind to reproduce that behavior.
In any event, if it's so important to know which MDB failed then why not simply write that information to the log?
-
17. Re: Re: Re: Multiple DLQs in HornetQ
sankalp.madaan Apr 16, 2014 6:54 AM (in response to jbertram)Actually I need that information to be stored in DB which will be used for later reprocessing the logic. Can you give any example using _HQ_ORIG_QUEUE property? Also can you verify my MDB has been declared properly. May be I am missing something there and that's why it is coming as null
@MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"), @ActivationConfigProperty(propertyName = "destination", propertyValue = "/topic/NORSTopic"), @ActivationConfigProperty(propertyName = "user", propertyValue = "username"), @ActivationConfigProperty(propertyName = "password", propertyValue = "password"), @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"), @ActivationConfigProperty(propertyName = "clientID", propertyValue = "Durable-Sub"), @ActivationConfigProperty(propertyName = "connectorClassName", propertyValue = "org.hornetq.core.remoting.impl.netty.NettyConnectorFactory"), @ActivationConfigProperty(propertyName = "connectionParameters", propertyValue = "host=localhost;port=5445"), @ActivationConfigProperty(propertyName = "subscriptionName",propertyValue = "client1"), @ActivationConfigProperty(propertyName = "messageSelector",propertyValue = "affiliate = 'NNA'"), @ActivationConfigProperty(propertyName = "shareSubscriptions", propertyValue="true") })
-
18. Re: Re: Re: Multiple DLQs in HornetQ
jbertram Apr 16, 2014 10:38 AM (in response to sankalp.madaan)Actually I need that information to be stored in DB which will be used for later reprocessing the logic.
Obviously that will have to be done by your application since HornetQ doesn't use a database of any kind.
Can you give any example using _HQ_ORIG_QUEUE property?
Check my previous comment. I referenced an example.
Also can you verify my MDB has been declared properly.
Your MDB's activation configuration properties look fine to me.
-
19. Re: Re: Re: Re: Multiple DLQs in HornetQ
jbertram Apr 16, 2014 12:15 PM (in response to sankalp.madaan)Out of curiosity I modified the "mdb-cmt-setrollbackonly" example we ship in HornetQ to mimic what you're doing. Everything worked as expected with the "_HQ_ORIG_ADDRESS" property containing the subscription name and client ID the MDB was using.
I'm attaching that example here.
Please note, this was done on the "master" branch so it might not work if you're dropping it into an earlier version.
-
mdb-cmt-setrollbackonly.zip 19.8 KB
-
-
20. Re: Re: Multiple DLQs in HornetQ
jbertram Apr 16, 2014 8:42 PM (in response to jbertram)FYI - I added a new Java EE example to the HornetQ distribution in https://github.com/hornetq/hornetq/pull/1619 to demonstrate this functionality.
-
21. Re: Re: Multiple DLQs in HornetQ
sankalp.madaan Apr 18, 2014 9:29 AM (in response to jbertram)Thanks Justin. I checked the examples. I am doing exactly the same. The only difference between your example and my code is that I am using an object Message instead of text message and I am using a MDB listener for DLQ instead of creating a receiver. But I am getting name of topic for _HQ_ORIG_ADDRESS and null for _HQ_ORIG_QUEUE. I am not able to figure out what I am missing.
-
22. Re: Re: Multiple DLQs in HornetQ
jbertram Apr 18, 2014 9:59 AM (in response to sankalp.madaan)I did a quick change on the example to test with an ObjectMessage rather than a TextMessage and everything worked as expected. To investigate further I'll need some kind of test case or example from you to demonstrate the behavior you're seeing.