I am interested in using RedeliveryPolicy in Camel to retry redelivery of a message to an endpoint when a certain exception is returned. But I cannot seem to find many examples of how to configure it.
At the moment I am trying:
from("direct:entry")
.onException(ResourceNotFoundException.class)
.redeliveryPolicy(new RedeliveryPolicy().delayPattern("delayPattern=0:" + aocmDelay + ",10:1000;15:2000:19:10000"))
.handled(true)
.end()
.to("direct:destination");
I have the destination endpoint failing with a ResourceNotFoundException but the onException handling is not being called and the redelivery does not take effect. Any ideas of what I am doing wrong?