Type: Bug
Component:
SQS
Describe the bug
AbstractMessagingTemplate.handleFailedSendBatch creates SendBatchOperationFailedException with a hardcoded empty string as the exception message (spring-cloud-aws-sqs 4.0.0):
//AbstractMessagingTemplate.java
private <T> CompletableFuture<SendResult.Batch<T>> handleFailedSendBatch(String endpoint, SendResult.Batch<T> result) { return CompletableFuture.failedFuture(new SendBatchOperationFailedException("", endpoint, result)); }
e.getMessage() always returns "", making the exception silent in logs. The failure details (error code,
senderFault) are accessible via e.getSendBatchResult().failed() but are never included in the message string.
Sample
- Send a batch via SqsTemplate.sendMany() where at least one message fails at the AWS level (e.g. invalid
attribute type, missing FIFO headers)
- Catch SendBatchOperationFailedException and call e.getMessage()
- Result: "" — no diagnostic information
Type: Bug
Component:
SQS
Describe the bug
AbstractMessagingTemplate.handleFailedSendBatchcreatesSendBatchOperationFailedExceptionwith a hardcoded empty string as the exception message (spring-cloud-aws-sqs 4.0.0)://AbstractMessagingTemplate.java
private <T> CompletableFuture<SendResult.Batch<T>> handleFailedSendBatch(String endpoint, SendResult.Batch<T> result) { return CompletableFuture.failedFuture(new SendBatchOperationFailedException("", endpoint, result)); }e.getMessage()always returns "", making the exception silent in logs. The failure details (error code,senderFault) are accessible via
e.getSendBatchResult().failed()but are never included in the message string.Sample
attribute type, missing FIFO headers)