Search code examples
amazon-web-servicesspring-bootspring-cloudsqslistener

Spring Cloud AWS. SQS. How to configure for FIFO queues


I am using standard setup for SqsListener.

On class level

@Component 

Then on method level I have this annotation:

@SqsListener

And all works as expected, but what I noticed that there is a warning in my app log:

io.awspring.cloud.messaging.listener.SimpleMessageListenerContainer:[]-AmazonSQSBufferedAsyncClient that Spring Cloud AWS uses by default to communicate with SQS is not compatible with FIFO queues. Consider registering non-buffered AmazonSQSAsyncClient bean.

When I checked the suggested class I found that it is depreciated already. So any idea how to configure spring boot for fifo queues and get rid of this message?

Thanks in advance.


Solution

  • AmazonSQSBufferedAsyncClient that Spring Cloud AWS uses by default to communicate with SQS is not compatible with FIFO queues. To use FIFO queues with Spring Cloud SQS it is recommended to overwrite default SQS client bean with a custom one that is not based on AmazonSQSBufferedAsyncClient.

    See https://docs.awspring.io/spring-cloud-aws/docs/2.4.0/reference/html/index.html