table of Contents
Idempotence scene
- Network latency resulting in repeated submission.
- Repeat submit the form.
solution
Each time you submit uses a Token, Token temporary and only to ensure
token generation rule (single application): token + UUID
- Redis to generate a token stored in the interface before each call.
- When the call interface, the generated token into the request header.
- Interface header token acquisition request, to redis query token is present, there is delete the token and execute business logic.
- If you can not find the token redis not be repeated in the prompt submission.
token generation rules (distributed): token + distributed global id