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

sendMessageBatch method sends the original messages instead of references to s3 to SNS #68

Closed
shotmk opened this issue Dec 26, 2021 · 0 comments

Comments

@shotmk
Copy link
Contributor

shotmk commented Dec 26, 2021

sendMessageBatch is sending the original messages instead of references to s3 bucket.
Files are uploaded to s3 too though.

Looks like we are building batchEntries in AmazonSQSExtendedClient:618 - AmazonSQSExtendedClient:628, but we forget to update the builder with new entries before submitting the request to underlying sqsClient instance.

List<SendMessageBatchRequestEntry> batchEntries = new ArrayList<>(sendMessageBatchRequest.entries().size());

        for (SendMessageBatchRequestEntry entry : sendMessageBatchRequest.entries()) {
            //Check message attributes for ExtendedClient related constraints
            checkMessageAttributes(entry.messageAttributes());

            if (clientConfiguration.isAlwaysThroughS3() || isLarge(entry)) {
                entry = storeMessageInS3(entry);
            }
            batchEntries.add(entry);
        }

        return super.sendMessageBatch(sendMessageBatchRequest);

Probably we want to do smth like:

return super.sendMessageBatch(sendMessageBatchRequest.toBuilder().entries(batchEntries).build());
shotmk pushed a commit to shotmk/amazon-sqs-java-extended-client-lib that referenced this issue Dec 26, 2021
Make sure we send updated SendMessageBatchRequest entries when message payload is transfered through s3.
@shotmk shotmk mentioned this issue Dec 26, 2021
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

No branches or pull requests

1 participant