Retry without performing a business operation twice
A timeout first tells you that a response did not arrive in time. The receiving system may still have accepted the request. Retrying blindly can therefore create duplicate records or repeat a business action.
Give retries a business identity
- Assign a stable identifier to one logical operation.
- Reuse that identifier for a technical retry.
- Retain a traceable record of completed processing steps.
- Report a conflict when different data arrives under the same identifier.
The identifier must reflect the business operation. A new HTTP request is not automatically a new order. Conversely, a genuinely new operation must not be discarded as a repetition of an earlier one.
A useful integration test interrupts the response after successful processing and then retries the request. Verify the intended business outcome directly in the receiving system. Coordination with that system matters as much as the sender's retry mechanism.