I don't know that code well enough to guess at the answer, and I may not have time to try to reproduce what you're seeing for a while. But since you're able to show that #1 works and #2 doesn't, grab a debugger and look at what's different in the redelivery policy map after running the two pieces of code. The first thing I'd look at is whether maybe the second block of code results in two entries in the map in such a way that your entry isn't being called...
Tim On Thu, Mar 28, 2019 at 7:33 AM W.Y <wyan...@gmail.com> wrote: > i also changed code a little bit, first example code works, second example > code does not work ## > Do you have any idea why? i need to find a way to define serveal > queuePolicies instead of only one > > ### it works for redelivery ### > > RedeliveryPolicy queuePolicy =connectionFactory.getRedeliveryPolicy(); > queuePolicy.setInitialRedeliveryDelay(0); > queuePolicy.setRedeliveryDelay(3000); > queuePolicy.setUseExponentialBackOff(true); > queuePolicy.setMaximumRedeliveries(3); > > ### it does not work for redelivery#### > > RedeliveryPolicy queuePolicy=new RedeliveryPolicy(); > queuePolicy.setInitialRedeliveryDelay(0); > queuePolicy.setRedeliveryDelay(3000); > queuePolicy.setUseExponentialBackOff(true); > queuePolicy.setMaximumRedeliveries(3); > > RedeliveryPolicyMap map=connectionFactory.getRedeliveryPolicyMap(); > map.put(new ActiveMQQueue(">"), queuePolicy); > > > > > -- > Sent from: > http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html >