-
Notifications
You must be signed in to change notification settings - Fork 90
feat(idempotency): Add support for ReturnValuesOnConditionCheckFailure in Idempotency. #1821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…lure in Idempotency.
|
...core/src/main/java/software/amazon/lambda/powertools/idempotency/persistence/DataRecord.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work on the PR, I left two comments but you can resolve if you don't find them relevant.
Also TIL about transient
- neat!
...core/src/main/java/software/amazon/lambda/powertools/idempotency/persistence/DataRecord.java
Show resolved
Hide resolved
...core/src/main/java/software/amazon/lambda/powertools/idempotency/persistence/DataRecord.java
Show resolved
Hide resolved
@phipag feel free to merge any time. No rush - just letting you know I'm ok with the comments and have resolved all the threads. |
Awesome! Thanks for your prompt review. Merging now. |
Issue #, if available: #1784
Description of changes:
This feature avoids redundant DynamoDB calls in the Idempotency utility by making use of the
ReturnValuesOnConditionCheckFailure
option in the AWS SDK.Instead of re-fetching a data record from the persistence store when a
IdempotencyItemAlreadyExistsException
is thrown, it attaches the offending data record to the exception so that it can be directly returned to the caller without making another DynamoDB call.Note: In addition to unit tests, I ran E2E tests as well. Until E2E tests are restored in GitHub workflows, here is the output from running in my AWS account.
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.