Skip to content
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

Issue 55 #56

Merged
merged 4 commits into from
Oct 6, 2020
Merged

Issue 55 #56

merged 4 commits into from
Oct 6, 2020

Conversation

adam-aws
Copy link
Contributor

Issue #55

Description of changes:
Allow consumer in ReceiveMessage call to convert a MessageS3Pointer payload:
["com.amazon.sqs.javamessaging.MessageS3Pointer", {"s3BucketName": "...", "s3Key": "..."}]
to:
["software.amazon.payloadoffloading.PayloadS3Pointer", {"s3BucketName": "...", "s3Key": "..."}]

Allowing users to upgrade to version 1.1.x from 1.0.x and still be able to receive either MessageS3Pointer or PayloadS3Pointer.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@@ -354,6 +354,9 @@ public ReceiveMessageResult receiveMessage(ReceiveMessageRequest receiveMessageR
Optional<String> largePayloadAttributeName = getReservedAttributeNameIfPresent(message.getMessageAttributes());
if (largePayloadAttributeName.isPresent()) {
String largeMessagePointer = message.getBody();
largeMessagePointer = largeMessagePointer.contains("software.amazon.payloadoffloading.PayloadS3Pointer") ?

Choose a reason for hiding this comment

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

String manipulation of JSON seems uncouth. Anyway, beyond that I guess it doesn't matter much but:

  1. this contains seems unnecessary since the replace will no-op if it's not present
  2. replaceFirst is regex-based, so the raw/unescaped . are matching any character; perhaps just use replace(CharSequence, CharSequence)?

@adam-aws adam-aws merged commit 2568cec into awslabs:master Oct 6, 2020
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