As discussed here, currently SqsTemplate fails if more than 10 messages are provided in a batch with an error from AWS SDK.
We can add support for this use case by partitioning the message list in batches of 10, while also sending the batches in parallel.
This change would likely be around here:
|
protected <T> CompletableFuture<SendResult.Batch<T>> doSendBatchAsync(String endpointName, |
|
Collection<Message> messages, Collection<org.springframework.messaging.Message<T>> originalMessages) { |
|
logger.debug("Sending messages {} to endpoint {}", messages, endpointName); |
|
return createSendMessageBatchRequest(endpointName, messages).thenCompose(this.sqsAsyncClient::sendMessageBatch) |
|
.thenApply(response -> createSendResultBatch(response, endpointName, |
|
originalMessages.stream().collect(Collectors.toMap(MessageHeaderUtils::getId, msg -> msg)))); |
|
} |
As discussed here, currently
SqsTemplatefails if more than 10 messages are provided in a batch with an error from AWS SDK.We can add support for this use case by partitioning the message list in batches of 10, while also sending the batches in parallel.
This change would likely be around here:
spring-cloud-aws/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/operations/SqsTemplate.java
Lines 350 to 356 in 562b933