-
1. Re: Multiple DLQs in JBoss 6.1
sankalp.madaan Mar 21, 2014 9:48 AM (in response to sankalp.madaan)People, I know this is a very basic question but it will help us in preparing the architecture. Please help !!
-
2. Re: Multiple DLQs in HornetQ
ulf.schroeter Mar 21, 2014 3:25 PM (in response to sankalp.madaan)An MDB is just a normal JMS message consumer and I think there is NO possibility to direct undelivered messages for a single topic to different DLQ based on failed consumer. DLQ's are related to message adresses, but not to consuming MDB's. Chapter 21. Message Redelivery and Undelivered Messages
-
3. Re: Multiple DLQs in HornetQ
jbertram Mar 21, 2014 4:22 PM (in response to sankalp.madaan)1 of 1 people found this helpfulUlf is right. DLQ configuration is tied to the address, not the consumer (e.g. an MDB).
However, I think you can get the behavior your after by using a divert to route the message to 2 different addresses (each with its own DLQ) and then have each MDB consume from the appropriate address.
-
4. Re: Multiple DLQs in HornetQ
ulf.schroeter Mar 22, 2014 4:38 AM (in response to jbertram)Right, but then most probably an additional DLQ per individual address (=individual consumer MDB) seems to be needless. If a specific MDB is down messages simply could stay within individual address without need to send it to DLQ. This would also simplify message recovery after MDB restart.
Nevertheless the overall planned usage approach of an additional DLQ for monitoring proper MDB activity (at least this is my assumption what you want to achieve) seems to be somehow wrong to me. Instead either you should monitor steadily increasing message count within individual address proposed by Justin as indicator for MDB failure or use any other application server management api for controlling MDB state.
-
5. Re: Multiple DLQs in HornetQ
jbertram Mar 22, 2014 2:54 PM (in response to ulf.schroeter)To your point, a DLQ is message-centric, not consumer-centric. It's a mechanism to deal with messages that are not processed properly regardless of the underlying problem. It is not meant to identify a particular consumer or provide details about the nature of the failure.
-
6. Re: Multiple DLQs in HornetQ
sankalp.madaan Mar 24, 2014 7:22 AM (in response to jbertram)Yes Justin, you are right. Actually in my case MDB is never down. It is calling a web service and on the basis of response I am getting, I am deliberately making the transaction rollbacked.
However, I think you can get the behavior your after by using a divert to route the message to 2 different addresses (each with its own DLQ) and then have each MDB consume from the appropriate address.
Can you tell the way to do that? I think this will solve my problem. What do you mean by saying 2 different addresses? 2 different topics(or queues)?
-
7. Re: Multiple DLQs in HornetQ
sankalp.madaan Mar 24, 2014 9:26 AM (in response to ulf.schroeter)Sorry Ulf for being not clear in my query. Actually my MDB is never down. In MDB, I am sending the message to some outside party using a web service and on the basis of response I am getting, I am doing rollback for the transaction. The problem I am facing is that, I am not able to determine which message got undelivered for which MDB in DLQ, so that I can reprocess accordingly. So i am looking for a way for having 1 DLQ per address.
-
8. Re: Multiple DLQs in HornetQ
jbertram Mar 24, 2014 10:50 AM (in response to sankalp.madaan)1 of 1 people found this helpfulActually I think you can get what you need simply by looking at the String property "_HQ_ORIG_ADDRESS" on the messages in the DLQ. That property indicates to what address the message was originally sent.
-
9. Re: Multiple DLQs in HornetQ
jbertram Mar 24, 2014 11:37 AM (in response to jbertram)BTW, this is documented here.
-
10. Re: Multiple DLQs in HornetQ
sankalp.madaan Mar 24, 2014 12:29 PM (in response to jbertram)Thanks Justin. Last 1 query. What does this original address refer to? Address of Topic or address of subscriber? If it is address of subscriber, is it similar to client ID or different?
-
11. Re: Multiple DLQs in HornetQ
jbertram Mar 24, 2014 12:52 PM (in response to sankalp.madaan)I'm not exactly sure what you mean by, "Address of Topic or address of subscriber."
The property refers the the address where the message was originally sent. Since multiple addresses can route to the same DLQ this property can be used to identify where the message was originally sent so it can be dealt with appropriately.
It has nothing to do with client ID.
-
12. Re: Multiple DLQs in HornetQ
sankalp.madaan Mar 24, 2014 1:29 PM (in response to jbertram)Thanks Justin. I will try out this now. Thanks for helping.
-
13. Re: Multiple DLQs in HornetQ
sankalp.madaan Apr 14, 2014 1:57 PM (in response to sankalp.madaan)I tried this property Justin. It gave me the name of the Topic to which the message was originally destined. But I want to know from which subscriber it failed. Can you advise any method?
-
14. Re: Multiple DLQs in HornetQ
jbertram Apr 14, 2014 2:01 PM (in response to sankalp.madaan)Look at the name of the subscription to which the message was sent (i.e. the "_HQ_ORIG_QUEUE" property). That might help you determine what subscriber failed because each subscriber gets their own subscription (i.e. queue).
However, as I indicated previously in this thread, "[a DLQ] is not meant to identify a particular consumer or provide details about the nature of the failure."