ISSUE-30: Support ignoring payload when not found in s3#33
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.
Why do we need casting here?
There was a problem hiding this comment.
I think that e.getCause() is Throwable at this point
Added
ignorePayloadNotFoundoptional 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