Menu

Post image 1
Post image 2
1 / 2
0

Idempotency4j - Java/Spring Boot idempotency library

DEV Community·Josip Musa·19 days ago
#08rcoEkm
Reading 0:00
15s threshold

The last couple of months, I ended up implementing idempotency in 2 different Spring Boot projects back to back. As I was implementing it in the second project, I decided to look up any existing solutions/libraries for Java/Spring Boot, but I honestly couldn't find one that felt clean and flexible enough for what I needed (and what most people probably need). So I decided to build my own and open source it. The goal was to make idempotency implementations feel straightforward and easy, but also to not scope it only to spring boot or a certain storage implementation. The library has a core which can be used on any method with pluggable storage backends. It also has an integration with spring web (servlet-based for now) and a spring boot starter to simplify usage. Usage example for a spring boot project: @PostMapping("/payments") @Idempotent public ResponseEntity<Payment> createPayment(@RequestBody PaymentRequest request) { // Runs exactly once per unique Idempotency-Key value.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More