Fix/concurrent requests#29
Conversation
| "idempotent.key.header", | ||
| "idempotent.inprogress.max.retries", | ||
| "idempotent.inprogress.retry.initial.intervalMillis", | ||
| "idempotent.inprogress.retry.initial.intervalMillis", // FIXME --> |
|
Since |
|
Hi @arun0009 Regarding the breaking change fix, do you mean implementing it now or reverting to the previous behavior? It might make more sense to handle it in a major version and refactor the properties across the modules. For the IdempotentService, would it make sense to add an overloaded method that accepts a waitStrategy parameter as well? |
|
ok
ok
ok
Now it’s not a problem because the type is saved by Jackson in the various store implementations. See commit: DynamoIdempotentStore for DynamoDB. However, I can still add it if needed. |
|
@burl21 - you should have access to create branches on this repo now. Its easier for both of us to create PRs/review. |
|
@arun0009
Currently, it is not a breaking change; in fact, it’s an improvement because the binding supports both camelCase and kebab-case. I added a binding test and removed the .json file because it is now auto-generated by the configuration processor.
I’ll add it in a separate PR since it requires changes to both the service and the completion awaiter. For a custom WaitStrategy, it’s already possible to instantiate the service by providing a custom wait strategy. |
…uests in the core service
…ration handling and remove reflection-based field setup
…figuration class and remove redundant bean declarations across modules
…introduce status check utility in `IdempotentStore`
…pendencies, and concurrent operation logic across modules
… to clarify strict insert behavior and exceptions
…apper`, simplify existing operation handling logic, and disable a test case
…nvention, remove deprecated test, and add new test cases for camel and kebab case bindings
2316733 to
e5d49ca
Compare
|
@arun0009 gentle ping 🙂 |
|
Also we should bump the version to 2.2.0 as part of this PR |
|
|
@burl21 : 2.2.0 released successfully! Great work and nicely handled it all in core. |
This PR fixes an issue where concurrency was not correctly handled when requests shared the same idempotency key. Previously, both requests were executing the business logic because they were treated as new requests; this behavior was present across all store implementations. An upsert was being performed, overwriting the key instead of enforcing a strict insert.
Conflict handling is now managed in the core by catching the exception and, when it occurs, treating the request as already existing.
This PR also adds waitForCompletion handling to IdempotentService, centralizing the logic in a single place for both the aspect and the service.
Additionally, properties have been extracted from IdempotentAspect into a separate class. Unfortunately, this introduced a breaking change (see //FIXME in core.ConfigurationProcessorTest).
I tried to group the changes logically by commit 🙂