the message consumption speed is extremely slow

0

I created a topic in SQS and used org.springframework.cloud.aws.messaging.listener.annotation.SqsListener in my Spring Boot project to listen to and consume messages from the topic. However, the message consumption speed is extremely slow. I sent 1000 messages, and it took almost 3 hours to consume all of them. Even when I used asynchronous threads to handle the code on the consumer side, it still took an hour. Here is my listener code: @SqsListener(value = "myDeliverySQS", deletionPolicy = SqsMessageDeletionPolicy.ON_SUCCESS)

asked a month ago38 views
2 Answers
0

Hello.

How about increasing the value of "maxConcurrentMessages" to increase the amount of messages that can be processed at once?
By default, it seems that 10 messages are retrieved at a time.
https://docs.awspring.io/spring-cloud-aws/docs/3.1.0/reference/html/index.html#sqslistener-annotation
https://docs.awspring.io/spring-cloud-aws/docs/3.1.0/reference/html/index.html#message-processing-throughput

profile picture
EXPERT
answered a month ago
profile picture
EXPERT
reviewed 10 days ago
0

The slow message consumption in your SQS listener may be due to improper queue configuration, such as a long visibility timeout or low message batch size.

Polling intervals could also be too long, and your listener’s processing logic might have bottlenecks, like synchronous operations or inefficient thread pool usage.

To improve performance, adjust the queue settings, increase concurrency, optimize the thread pool, and ensure non-blocking message handling.

profile picture
EXPERT
answered 10 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions