git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Broker redelivery predispatch check across consumers is not working


Two things:

1. You have max redeliveries set to 0 for the consumers but 1 for the
broker. Is the behavior in the face of that mismatch what's in question
here? Do you get correct behavior if the settings match?

2. How many times does the message get redelivered? Your description didn't
say that explicitly, but it sounds like it was delivered twice (redelivered
once), which would be correct for the broker configuration. Is that an
accurate description of what happened?

Tim

On Mon, Oct 29, 2018, 10:19 AM djdkedev <djtest9@xxxxxxxxx> wrote:

> Hello,
>
> I want to add the redelivery counter check at embedded broker level but
> across consumers. Once redelivery counter is exceeded then message should
> enter into DLQ. I observed that, when client terminates without sending ack
> "INDIVIDUAL_ACKNOWLEDGE" then message is redelivered to another consumer
> even though redeliver counter set into the redelivery plugin is exceeded?
> The client has set jms.redeliveryPolicy.maximumRedeliveries=0.
>
> *
> code snippet:*
>                         broker.setSchedulerSupport(true);
>                          RedeliveryPlugin redeliveryPlugin = new
> RedeliveryPlugin();
>
>
> redeliveryPlugin.setSendToDlqIfMaxRetriesExceeded(true);
>                         redeliveryPlugin.setFallbackToDeadLetter(true);
>
>                         RedeliveryPolicy queueEntry = new
> RedeliveryPolicy();
>                         queueEntry.setRedeliveryDelay(1000);
>                         queueEntry.setInitialRedeliveryDelay(5000);
>                         queueEntry.setMaximumRedeliveries(1);
>                         queueEntry.setPreDispatchCheck(true);
>                         queueEntry.setDestination(new
> ActiveMQQueue(<queuename>));
>
>                 RedeliveryPolicy defaultEntry = new RedeliveryPolicy();
>                 defaultEntry.setInitialRedeliveryDelay(5000);
>                 defaultEntry.setMaximumRedeliveries(1);
>                 defaultEntry.setPreDispatchCheck(true);
>
>                 RedeliveryPolicyMap redeliveryPolicyMap = new
> RedeliveryPolicyMap();
>                 redeliveryPolicyMap.setDefaultEntry(defaultEntry);
>
> redeliveryPolicyMap.setRedeliveryPolicyEntries(Arrays.asList(queueEntry));
>
>
> redeliveryPlugin.setRedeliveryPolicyMap(redeliveryPolicyMap);
>
>                 LoggingBrokerPlugin logPlugin = new LoggingBrokerPlugin();
>                 logPlugin.setLogAll(true);
>
>                 broker.setPlugins(new BrokerPlugin[]{redeliveryPlugin,
> logPlugin});
>
> Could you please help?
>
> Thanks,
> Dhananjay
>
>
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>