-
Notifications
You must be signed in to change notification settings - Fork 3
Description
A ContractRequestMessage can initiate a negotiation or send a consumer counteroffer to the provider. Since these messages must be idempotent to support reliability, we need a way for the provider to perform unambiguous deduplication:
- The consumer sends a
ContractRequestMessageto the provider, which receives it - The provider creates a state machine, transitions it to CONSUMER_REQUESTED, and sends an ACK to the consumer
- The consumer crashes before it can commit the ACK
- The consumer recovers and sends the same
ContractRequestMessage
At this point, the provider needs to determine that the message is a duplicate and not an attempt by the provider to send a counteroffer, which would result in an illegal state transition. The converse of this is when a provider must determine that a message is a counteroffer, not an initial request.
The proposed solution is the presence of the negotiationId message. If the property is present in the message, the provider should process it as a counteroffer; otherwise, it should process the message as an initial request.