Spring Boot Idempotency with the Idempotency-Key header on PostgreSQL and Redis: exact response replay, request fingerprint validation, concurrent retry handling, problem details errors. A demo application showcasing the integration and usage of idempify - Spring Boot Idempotency Starter.
https://github.com/dmitriy-iliyov/idempify β// momentum
// why it's here
- Created 2 weeks ago and already shipping
- Has issues labelled for new contributors
- Health 87/100 with only 17 stars
- 23 forks for 17 stars: people build on it
// how to help
// readme
π Idempotency Key Pattern
Spring Boot idempotency with the Idempotency-Key header: every ride charged once, however often the client retries
A rider taps βBookβ on a train with a weak signal. The request reaches the server, the ride is booked and the card is charged, but the answer is lost in a tunnel. The app does what any app does without an answer: it sends the request again. Without protection the second request books a second ride and charges the card a second time, and the rider pays twice for one trip.
This repository is a ride-booking service that charges through Stripe and cannot be made to charge twice. Every booking carries an Idempotency-Key: the first request under a key books and charges, and every repeat under the same key gets the first answer back, status and body as they were, without booking or charging again. A repeat with a different body under the same key is refused, and a repeat that arrives while the first request is still running is told so instead of running beside it.