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
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?
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
1 of 1 people found this helpful
There 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
Still not clear to me what will happen if one subscriber will start after message was sent - he will never get that message, right?
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.