Hello, We have a simple Camel route from vm:xxx to jms:topic:yyy. The number of redelivery attempts has been set to infinite in the default error handler, so if the JMS provider goes down for some reason, Camel will retry to deliver the currently processed message until the JMS provider is up again. If the Camel context is asked to shut down gracefully, it will wait until the inflight messages are processed and then will shut down. But if the JMS provider goes down and then I initiate shutdown of the Camel context, the inflight messages will never be delivered and removed, because the JMS provider is unavailable, and Camel will shut down forcibly 5 minutes later due to the default shutdown strategy timeout. This waiting is annoying, so I decided to invoke org.apache.camel.builder.DefaultErrorHandlerBuilder.allowRedeliveryWhileStopping(false). It had some effect, but it was not what I wanted to achieve. Indeed some inflight messages were removed, but not all of them and again I had to wait the whole 5 minutes. The problem here was that, although it was only one, a delivery attempt for a message took 10-12 seconds - during the 5 minutes period only 25-30 messages were removed.
I'd like to know if there is a way to make Camel discard all inflight messages routed to a non-reachable JMS provider during shutdown. Only them, not the ones routed to a valid JMS provider. We are perfectly OK with getting rid of all undeliverable inflight messages in this case, as we store them on the file system before pushing them to Camel and we can easily resend them the next time. I'd appreciate any suggestions and ideas. Thank you. -- View this message in context: http://camel.465427.n5.nabble.com/Discarding-inflight-messages-on-shutdown-and-unavailable-JMS-provider-tp5754590.html Sent from the Camel - Users mailing list archive at Nabble.com.