I did some more digging with the following scenario:

I have one topic with two durable subscribers. Both subscribers always
throw an exception when handling a message. This should result in the
messages being sent to a dead letter queue specific to the subscriber,
since that's what I've configured on the IndividualDeadLetterStrategy using
the destinationPerDurableSubscriber attribute.

It seems like IndividualDeadLetterStrategy does not take into account there
could be multiple subscribers involved when checking for duplicates. See
the following snippet from AbstractDeadLetterStrategy:

    @Override

    public boolean isSendToDeadLetterQueue(Message message) {

        boolean result = false;

        if (message != null) {

            result = true;

            if (enableAudit && messageAudit.isDuplicate(message)) {

                result = false;

the messageAudit.isDuplicate returns true when processing the second
subscriber for a message. When invoked for the message failing at the
second subscriber, the isDuplicate() will return true causing the message
not ending up in it's own "destinationPerDurableSubscriber" dead letter
queue.

Is there something I'm overlooking here or should I create a JIRA issue for
this ?

Xander





On Tue, Oct 14, 2014 at 3:34 PM, Xander Uiterlinden <uiter...@gmail.com>
wrote:

> Hi,
>
> I'm trying to setup individual DLQ's for each of the subscribers to a
> topic.
> I tried setting this up using the destinationPerDurableSubscriber="true"
> for the individualDeadLetterStrategy as follows:
>
>        <destinationPolicy>
>             <policyMap>
>               <policyEntries>
>                 <policyEntry topic=">" >
>                     <!-- The constantPendingMessageLimitStrategy is used
> to prevent
>                          slow topic consumers to block producers and
> affect other consumers
>                          by limiting the number of messages that are
> retained
>                          For more information, see:
>
>
> http://activemq.apache.org/slow-consumer-handling.html
>
>                     -->
>                   <pendingMessageLimitStrategy>
>                     <constantPendingMessageLimitStrategy limit="1000"/>
>                   </pendingMessageLimitStrategy>
>   <deadLetterStrategy>
> <individualDeadLetterStrategy topicPrefix="DLQ."
> destinationPerDurableSubscriber="true" />
>   </deadLetterStrategy>
>                 </policyEntry>
>               </policyEntries>
>             </policyMap>
>         </destinationPolicy>
>
> When testing this configuration I notice mixed results which seems pretty
> random. One time a message has been put in the correct DLQ whereas the next
> time it has been put in the DLQ specific to another subscriber to the same
> topic.
>
> Could I be missing something in this configuration ?
> Could transactions be interfering ?
>
> Kind regards,
>
> Xander
>

Reply via email to