-
1. Re: dead letter and topics
ataylor Feb 14, 2010 7:11 AM (in response to yairogen)Actually it is a dead letter address not a queue. Internall HornetQ has no notion of queues. A Topic is just an address where each subscriber has its own queue bound to that address. So if there are no subscribers the message will not be routed any where and will in effect just disappear. If there are 2 subcribers then there will be 2 queues bound to the address, each will handle redelivery of the message and forward it to the dead letter address after n tries, and tes if the client throws an exception the message will be redelivered1 of 1 people found this helpful -
2. Re: dead letter and topics
yairogen Feb 14, 2010 9:42 AM (in response to ataylor)Let me make sure I got this right:
If I have 5 subscribers and a durable Topic.
If user sends a message to the topic.
If only 4 subscribers are up - one of them will lose his message. correct?
If one of the 4 throws an exception, after n retries it will go to the DLQ. correct?
if 2 subscribers throw an exception than I will see 2 identical messages in the DLQ. correct?
If all the subscribers are down - what will happen to the message sent? It will disappear?
Thanks.
-
3. Re: dead letter and topics
ataylor Feb 15, 2010 4:54 AM (in response to yairogen)Well firstly this all depends on on whether your subscribers are durable or not. I would suggest reading a JMS tutorial, the Sun one is good.
Think of a topic as an address where each subscription has its own queue and handles its one copy of a message (actually we only we keep one copy and use references), if a message is redelivered n times by the queue it will be sent to the DLA (dead letter address) so yes if 2 subscribers throw an exception there will be 2 messages routed to the DLA (actually its 2 references to the same message). If there are no subscriptions there is no where for the message to be routed too.
Hope that makes sense
-
4. Re: dead letter and topics
timfox Feb 15, 2010 4:56 AM (in response to ataylor)1 of 1 people found this helpfulThere is also a flag you can set on the address settings: send-to-dla-on-no-route
If true and message is not routed anywhere it will be routed to the dla
-
5. Re: dead letter and topics
yairogen Feb 16, 2010 3:13 AM (in response to ataylor)Still not clear to me what will happen if one subscriber will start after message was sent - he will never get that message, right? -
6. Re: dead letter and topics
ataylor Feb 16, 2010 9:08 AM (in response to yairogen)If the subscriber is non durable then no, it wont receive the message. Like i said before there are plenty of good tutorials that explain this stuff in detail. -
7. Re: dead letter and topics
timfox Feb 16, 2010 9:10 AM (in response to ataylor)ataylor wrote:
http://java.sun.com/products/jms/tutorial/1_3_1-fcs/doc/advanced.html#1024758