Skip to content

Added ability to retrieve message details in case of failed to get data from S3 #17

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

krzysztof-at-mp
Copy link

I found your library very helpful in case of bigger payloads. When doing tests I found some scenarios that cannot be covered using existing implementation because the lack of information about messages received from the Amazon service (sqs).
In my scenario I would like to be able to get the receipt handle and delete the message when I get AmazonS3Exception saying the payload is gone (somehow removed) while receiving the message.

Hope you will find my PR usefull.

Copy link
Owner

@raol raol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution.
However I have minor comment regarding messages deletion.
I would be grateful if you could check and add the same handling if my assumptions are valid.

message.ReceiptHandle = EmbedS3PointerInReceiptHandle(message.ReceiptHandle, messageS3Pointer.S3BucketName, messageS3Pointer.S3Key);
message.MessageAttributes.Remove(SQSExtendedClientConstants.RESERVED_ATTRIBUTE_NAME);
}
catch (AmazonClientException amazonClientException)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the same try/catch be used when the message is removed from the queue?
I mean, if one tries to delete non-existing s3 payload, will exception be raised?
If so, then it would be nice to have the same exception handling logics there.

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.

2 participants