Skip to content

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

@shotmk

Description

@shotmk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions