Skip to content
System integrationIn practice1 min read

Retry a request without duplicating the work

A broken connection can require another request. It should not necessarily create another record.

What happened when no reply arrived?

An order may have been created even if its sender did not receive the response. Resending without protection can create a second order.

Make the operation recognisable

For suitable operations, a unique operation key helps identify a previously processed request. A repeated request can return the earlier result instead of creating another record. Design this behaviour for each relevant endpoint.

Test the failure case

Test delayed responses, timeouts and repeated requests as well as the successful connection. Count the resulting records: actual operations matter more than the number of clicks.

Source: MDN: Idempotent

Questions&supportWhatsApp