Skip to content

ISSUE-30: Support ignoring payload when not found in s3#33

Merged
adam-aws merged 1 commit into
awslabs:masterfrom
Damiox:ISSUE-30
Aug 31, 2021
Merged

ISSUE-30: Support ignoring payload when not found in s3#33
adam-aws merged 1 commit into
awslabs:masterfrom
Damiox:ISSUE-30

Conversation

@Damiox

@Damiox Damiox commented Oct 25, 2018

Copy link
Copy Markdown
Contributor

Added ignorePayloadNotFound optional parameter in case you want to get rid of SQS messages that do not have their corresponding payload in Amazon S3

This PR is related to issue #30

@stanpalatnik

Copy link
Copy Markdown

+1

@PaulinaSuwardi

Copy link
Copy Markdown

I think it needs to check for the ignorePayloadNotFound==true before deleting the corresponding sqs message

@Damiox

Damiox commented Oct 26, 2018

Copy link
Copy Markdown
Contributor Author

You were right @PaulinaSuwardi - I just fixed that, and added a unit test to cover that use case. Thanks!

@smart-nick

Copy link
Copy Markdown

Love the fix. Any chance this can get merged/released?

@Damiox

Damiox commented Aug 1, 2019

Copy link
Copy Markdown
Contributor Author

@hyandell @kuba-aws @troy-aws - Would it be possible to get some feedback on this please? Thanks

@adam-aws

adam-aws commented Aug 6, 2021

Copy link
Copy Markdown
Contributor

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
@Damiox Damiox changed the title ISSUE-30 ISSUE-30: Support ignoring payload when not found in s3 Aug 28, 2021
@Damiox

Damiox commented Aug 28, 2021

Copy link
Copy Markdown
Contributor Author

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");

Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants