Operations on MessageExchange should throw IllegalStateException when a component that does not own the exchange in the current state calls them.
The bug is caused by the fact that MessageExchangeWrapper, which is responsible of doing that check, is shared between consumer and provider and thus doesn't reflect correctly the role of the owner of a reference to the message as it should.
(The code was actually documented as doing that, even though it wasn't, until commit r37114 where I corrected the documentation without realising the code should be fixed instead
.
A solution is to actually have 2 instances of the MessageExchangeWrapper, one for each actor of the exchange, so that their observerRole field actually reflect the reality.
The problem is that many code in the kernel relies on the fact that the object is shared between the consumer and the provider.