git.net

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

Broker redelivery predispatch check across consumers is not working


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