-
Notifications
You must be signed in to change notification settings - Fork 108
ISSUE-30: Support ignoring payload when not found in s3 #33
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
+1 |
I think it needs to check for the ignorePayloadNotFound==true before deleting the corresponding sqs message |
You were right @PaulinaSuwardi - I just fixed that, and added a unit test to cover that use case. Thanks! |
Love the fix. Any chance this can get merged/released? |
Looks like this PR has been here for a while which is unfortunate, the piece of logic it addresses has been moved to a new package https://github.com/awslabs/payload-offloading-java-common-lib-for-aws/blob/51021fcb6198c247045896cdc50bb4971eee47a4/src/main/java/software/amazon/payloadoffloading/S3BackedPayloadStore.java#L40 which should now be made there |
…want to get rid of SQS messages that do not have their corresponding payload
Hi @adam-aws, I just rebased this branch with latest master which is still addressing this issue within this library so the ignored messages (e.g. payload-not-found messages) can also be excluded from the result to the caller. Please take a look at it whenever you can. Thanks |
try { | ||
originalBody = payloadStore.getOriginalPayload(largeMessagePointer); | ||
} catch (AmazonServiceException e) { | ||
boolean isNoSuchKeyException = ((AmazonServiceException) e.getCause()).getErrorCode().equals("NoSuchKey"); |
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.
Why do we need casting here?
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.
I think that e.getCause()
is Throwable at this point
Added
ignorePayloadNotFound
optional parameter in case you want to get rid of SQS messages that do not have their corresponding payload in Amazon S3This PR is related to issue #30