Details
Description
This is an edge case, but when the following circumstances concur, the asynchronous routing engine in Camel become blocked:
- Sending an InOut exchange over JMS (request/reply), where:
- Persistent messages are enabled (deliveryPersistent=true)
- useMessageIDasCorrelationID is enabled
- replyToType is Temporary queues (default) (using TemporaryQueueReplyManager)
- a timeout is set
You have to be really unlucky, but if the following condition is satisfied, a thread will become blocked:
time the broker takes to ACK the produced message > message timeout
Hence, if we have a timeout of 3000ms, and the broker takes 4000ms to ACK the message (e.g. slow Disk I/O while the journal is rotating - it happened to us), at some point we'll see this.
2012-10-30 10:46:57,680 | WARN | CorrelationMap | 89 - org.apache.camel.camel-core - 2.8.0.fuse-06-11 | Exception occurred during purge task. This exception will be ignored. java.lang.NullPointerException
The CorrelationMap is rendered useless, so if subsequent exchanges time out, the ReplyHandler may never get an onTimeout callback, thus leading to the waiting thread getting blocked forever if the async routing engine was in place.