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

[Redeem][Application] sqsClient.sendMessageBatch should not exceed the batch size (current 10) #13

Closed
binchoo opened this issue Jun 28, 2022 · 1 comment
Assignees
Labels
Milestone

Comments

@binchoo
Copy link
Owner

binchoo commented Jun 28, 2022

As-is:
This code is trying to send the redemption requests for all users at once.
The batch size should be less than equal to 10.

private void sendToQueue(List<RedeemTask> redeemTasks) {
List<SendMessageBatchRequestEntry> batchMessage = new LinkedList<>();
for (int i = 0; i < redeemTasks.size(); i++) {
batchMessage.add(new SendMessageBatchRequestEntry()
.withId(String.valueOf(i))
.withMessageBody(redeemTasks.get(i).getJson(objectMapper)));
}
sqsClient.sendMessageBatch(CODEREDEEM_QUEUE_NAME, batchMessage);
}

To-be:
Split requests into groups whose size is less than or equal to 10.

@binchoo binchoo added this to the release 1.0.2 milestone Jun 28, 2022
@binchoo binchoo self-assigned this Jun 28, 2022
@binchoo binchoo added the bug Something isn't working label Jun 28, 2022
@binchoo
Copy link
Owner Author

binchoo commented Jun 30, 2022

2.8 PV is on-air on Saturday July, 2nd.
Do this quickly.

@binchoo binchoo closed this as completed in d4b9fe8 Jul 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant