i also changed code a little bit, first example code works, second example code does not work
### 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); On Wed, Mar 27, 2019 at 10:19 AM W.Y [via ActiveMQ] < ml+s2283324n4749802...@n4.nabble.com> wrote: > that for the reply, i found the reson. then modified the activemq.xml like > below , it works > > then question is , the policyEntries i used is only for queue. > destinationPolicy is only for queue. > is there a example configuration of destinationPolicy for both of topic > and > queue ? > > <broker xmlns="http://activemq.apache.org/schema/core" > brokerName="localhost" dataDirectory="${activemq.data}" > > > <destinationPolicy> > <policyMap> > <policyEntries> > > <policyEntry queue=">"> > <deadLetterStrategy> > > <individualDeadLetterStrategy > queuePrefix="DLQ." > useQueueForQueueMessages="true"/> > </deadLetterStrategy> > </policyEntry> > </policyEntries> > </policyMap> > </destinationPolicy> > > > > -- > Sent from: > http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://activemq.2283324.n4.nabble.com/setTimetoLive-does-not-work-set-DeadLetterQueue-for-exceeding-maximum-redelivery-also-does-not-work-tp4749774p4749802.html > To unsubscribe from setTimetoLive does not work, set DeadLetterQueue for > exceeding maximum redelivery also does not work, click here > <http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4749774&code=d3lhbmJveEBnbWFpbC5jb218NDc0OTc3NHwxMTU1MzAzODM=> > . > NAML > <http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> >