It seems that some component put in the AsyncContext something else than what they send as the original message.
For example the EIP SE, when it forward an exchange and create a new one, stores in the AsyncContext the exchange that was used as a source to the new one…
But I'm pretty sure this field is not meant to be used like that, it makes no sense to put something related to message forwarding in the CDK…
The reason for its existence is that if the exchange succeed (i.e. if we get a response), we have both the original message and the new one. But since they are always the same (because the whole container is implemented so that the object identity of an exchange is preserved… even though it doesn't have to be so according to the JBI spec), then it's useless…
We will keep it like that anyway to be more "JBI compliant" since nothing (theoretically) prevent the answer exchange from being different than the sent one.
It still means that there may be errors in some of the components putting the wrong exchange in the AsyncContext!
It seems to me that they are both the same exchange: when sending an exchange, it is the one passed as a parameter to the AsyncContext creation.
It makes sense because there was a timeout, so we never got an answer to the sent exchange!
The solution would be to either remove the original exchange from the asynccontext, or not pass the original exchange back in onExpiredAsyncJBIMessage…
The first solution would be more elegant.