How to switch a freight adapter without creating duplicate submissions
Define which integration may send each operation during the switch. Treat in-flight requests and unknown outcomes as reconciliation work, not as a queue to replay blindly.
Choose one sender and inventory in-flight work.
Define the exact cutover scope: one adapter, operation, provider environment and set of shipments. Put the new path in compare-only mode where possible. Record which operations are queued, already acknowledged, cancelled or unresolved. Make the old sender stop accepting new work for the scoped operation before the new sender is enabled.
A lost response is not a failed submission.
RFC 9110 cautions against automatic retries of non-idempotent requests without a way to know the action is safe to repeat or was never applied. Confirm the provider’s contract and the scope and lifetime of any idempotency key before using it. When delivery is uncertain, reconcile against a trusted receipt or an approved status lookup.
- Duplicate event: replay a synthetic source event and verify the workflow records one business effect.
- Timeout during switchover: maintain an unresolved state and confirm whether the old sender applied the operation before allowing a repeat.
- Late acknowledgement: reconcile it to the original attempt instead of treating it as success for the new sender.
- Rollback: stop the new sender before enabling the old one; reconcile pending work and verify the same operation is not sent by both.
Require evidence that cutover preserves shipment state.
Proceed when the scoped backlog is explainable, the single-sender boundary holds and ambiguous outcomes have an owner. Record adapter versions, the cutover point and reconciliation counts. A rollback of application code does not undo a document or submission already accepted by another system.