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

Closes #68 #69

Merged
merged 1 commit into from
Jan 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -617,16 +617,22 @@ public SendMessageBatchResponse sendMessageBatch(SendMessageBatchRequest sendMes

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

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

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

if (hasS3Entries) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch, do we actually need this hasS3Entries ? Since batchEntries will contain the actual entries we want to send (some might be s3 pointers and some might be the actual message) we can update the entries for the sendMessageBatchRequest every-time.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess just to avoid having to copy the new entries.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for quick response! and for merging the PR :D

sendMessageBatchRequest = sendMessageBatchRequest.toBuilder().entries(batchEntries).build();
}

return super.sendMessageBatch(sendMessageBatchRequest);
}

Expand Down