Skip to content

SendBatchOperationFailedException is created with empty message string #1605

Description

@krechanski

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

  1. Send a batch via SqsTemplate.sendMany() where at least one message fails at the AWS level (e.g. invalid
    attribute type, missing FIFO headers)
  2. Catch SendBatchOperationFailedException and call e.getMessage()
  3. Result: "" — no diagnostic information

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions