I am using ActiveMQ-CPP 3.4.5 to connect from C++ program to message broker. The problem I encountered is connected with redelivery policy. Messages which are returned to queue are redelivered immediately. This is not the behaviour I expect. I would expect the messages to be returned after certain period of time which is set through redelivery policy.
This is a code snipped showing the way I set up redelivery policy:
policy = new activemq::core::policies::DefaultRedeliveryPolicy();
policy->setInitialRedeliveryDelay(0);
policy->setRedeliveryDelay(10000);
policy->setMaximumRedeliveries((int)activemq::core::RedeliveryPolicy::NO_MAXIMUM_REDELIVERIES);
connectionFactory.setRedeliveryPolicy(policy);
As I said before I would except the messages to be redelivered after 10000 ms, but the are not. They come back to consumer immediately.
Does anyone know what could be the reason of such behaviour?