Currently, if there is exchanges still in the queue of the DeliveryChannel when a component is shut down, these messages are simply lost.
For the new exchanges (those that are not answers to previous exchanges), it would make sense to reinject them in the router because:
either there is other provider that can answer them.
either there is not and the consumer should get an error for its request.
For the non-new exchange, an error should be sent back to the consumer.
This goes in the way to improve the reliability of the container for message delivery (PETALSDISTRIB-146).
Environment:
-
Issue Links
Depends
This issue blocks:
PETALSDISTRIB-146
Reliability aka delivery guarantees for consumer-provider communication
Victor NOËL added a comment - Thu, 7 Jan 2016 - 15:54:20 +0100 Open question: in case of non-new exchanges, should we send back an error or simply skip them (by logging it of course)?
Christophe DENEUX added a comment - Thu, 7 Jan 2016 - 16:11:06 +0100
FYI, no more service unit is deployed when shutting down a component.
So, IMO, when shutting down a component, the only messages that should be processed are the messages of new exchanges sent to the native endpoints that was enqueued when the component was stopped. These messages should be redirected to another similar endpoint is it exists, or an error (endpoint not found) should be returned.
Christophe DENEUX added a comment - Thu, 7 Jan 2016 - 16:11:06 +0100 FYI, no more service unit is deployed when shutting down a component.
So, IMO, when shutting down a component, the only messages that should be processed are the messages of new exchanges sent to the native endpoints that was enqueued when the component was stopped. These messages should be redirected to another similar endpoint is it exists, or an error (endpoint not found) should be returned.
Victor NOËL added a comment - Thu, 7 Jan 2016 - 16:16:19 +0100 Yeah I know… that's the whole point of this issue
What is your opinion on my open question?
Victor NOËL added a comment - Mon, 11 Jan 2016 - 15:39:02 +0100 Fixed in trunk.
An error is sent back if an exchange is still active but is not a new one (the MEP was already started).
Victor NOËL added a comment - Mon, 11 Jan 2016 - 17:11:25 +0100 Reopen: I forgot to handle the case when the component is in shutdown state and other exchanges arrive after. They must be reinjected too if possible.
Open question: in case of non-new exchanges, should we send back an error or simply skip them (by logging it of course)?