Every integration that moves something out of your system has the same weak point, and it is
not the happy path. It is the second attempt.
Your code posts a document to a provider. The connection drops before the response arrives. You now hold no job id, no confirmation and no idea whether anything left the building. The timeout told you about your network. It told you nothing about theirs.
So you retry, and you either send the thing twice or you never send it at all. Pick one, because
without help from the API you cannot have both.
Why the usual fixes do not fix it
The first instinct is a client-side guard. Hash the payload, keep a table of what you have already
sent, check it before each attempt.
That works until the duplicate attempt comes from a different process, a different container, or a
queue worker that started after a deploy. Your table is local state defending against a distributed
problem.
The second instinct is to ask the provider whether the job exists.…