-
Notifications
You must be signed in to change notification settings - Fork 945
Description
Describe the bug
Looking through the code, it looks like if the batch manager is created with an SQS client that has an override configuration, it sets the queueUrl
as the batchKey
.
https://github.com/aws/aws-sdk-java-v2/blob/master/services/sqs/src/main/java/software/amazon/awssdk/services/sqs/internal/batchmanager/SendMessageBatchManager.java#L100
This happens for all SQS request types (Send Message, Change Message Visibility, etc...)
The batchKey
is the original queue URL plus the override configuration hash code appended.
For example:
Original Queue URL:
https://sqs.us-west-2.amazonaws.com/487219371131/queue-name
Resulting Queue URL (Batch Key):
https://sqs.us-west-2.amazonaws.com/487219371131/queue-name-126351273
@joviegas looks like this code was implemented by you.
Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
The Queue URL should not be changed.
Current Behavior
The request errors with "Queue Does Not Exist:
software.amazon.awssdk.services.sqs.model.QueueDoesNotExistException
Reproduction Steps
Create a batch manager, and pass it an SQS client. Call the sendMessage
with an override configuration.
SqsAsyncClient asyncClient = SqsAsyncClient.create();
SqsAsyncBatchManager batchManager = asyncClient.batchManager();
SendMessageRequest request = SendMessageRequest.builder()
.queueUrl("https://sqs.us-west-2.amazonaws.com/487219371131/queue-name")
.messageBody("Hello")
.overrideConfiguration(...)
.build();
batchManager.sendMessage(request);
This behavior was noticed when using the SQS exended client implementation:
- https://github.com/awslabs/amazon-sqs-java-extended-client-lib/blob/master/src/main/java/com/amazon/sqs/javamessaging/AmazonSQSExtendedAsyncClient.java#L534
- https://github.com/awslabs/amazon-sqs-java-extended-client-lib/blob/master/src/main/java/com/amazon/sqs/javamessaging/AmazonSQSExtendedClientUtil.java#L131-L139
The lines above appends a user agent (updates override configuration).
Possible Solution
Set the queueUrl
as the original queue url, not the batchKey
? I'm not sure of the consequences, though.
Additional Information/Context
No response
AWS Java SDK version used
2.33.4
JDK version used
21
Operating System and version
Darwin 24.6.0 Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041 arm64