AmazonSQSClient is the Amazon Simple Queue Service client from version 1 of the AWS SDK for Java. In Spring Boot it was used to send, receive and delete messages on SQS queues. AWS SDK for Java v1 reached end of support on December 31, 2025, so new code should use SqsClient from SDK v2, or Spring Cloud AWS with SqsTemplate and @SqsListener.
This article covers what the class did, and how to do the same work today.
AmazonSQSClient implemented the AmazonSQS interface and called the SQS API over HTTPS. Applications injected the interface and used it for:
sendMessage and sendMessageBatch to publish messages.receiveMessage to poll for messages, with long polling through waitTimeSeconds.deleteMessage to acknowledge a processed message.changeMessageVisibility to extend processing time.createQueue, getQueueUrl and purgeQueue for queue management.Constructing AmazonSQSClient directly was deprecated in favour of AmazonSQSClientBuilder, and the whole v1 SDK is now unsupported.
Understanding the queue model matters more than the client class. SQS delivers each message at least once (standard queues) and hides it from other consumers for the visibility timeout after it is received. If you do not delete it before that timeout expires, it becomes visible again and is redelivered. This means consumers must be idempotent.
| Queue type | Ordering | Delivery |
|---|---|---|
| Standard | Best effort | At least once, occasional duplicates |
FIFO (name ends in .fifo) | Strict per message group | Exactly once processing within the deduplication window |
Add software.amazon.awssdk:sqs and declare the client bean:
Do not hard-code access keys. In AWS use an IAM role, and locally use environment variables or an SSO profile.
Delete a message only after processing succeeds. Long polling (up to 20 seconds) reduces empty responses and cost compared with short polling.
Writing a polling loop by hand is rarely necessary. Spring Cloud AWS 3.x provides SqsTemplate for sending and @SqsListener for consuming, including concurrency, batching and acknowledgement handling:
If the listener throws, the message is not deleted and returns after the visibility timeout. Configure a dead-letter queue with a maxReceiveCount so poison messages do not loop forever.
No. It belongs to AWS SDK for Java v1, which ended support on December 31, 2025. Move to SqsClient or Spring Cloud AWS.
That was part of the old Spring Cloud AWS 2.x line. Version 3 replaced it with SqsTemplate and @SqsListener built on SDK v2.
Standard queues are at-least-once, and a message also returns to the queue if processing outlasts the visibility timeout. Make handlers idempotent or use a FIFO queue.
Up to 10 per ReceiveMessage call, and up to 10 per batch send.
AmazonSQSClient was the SQS client of the retired AWS SDK for Java v1. Use SqsClient from SDK v2 for direct control, or Spring Cloud AWS SqsTemplate and @SqsListener for less code. Use long polling, delete messages only after success, attach a dead-letter queue and write idempotent consumers.