java-dynamic-sqs-listener icon indicating copy to clipboard operation
java-dynamic-sqs-listener copied to clipboard

Listen to two SQS queue from same springboot app

Open satheesh83 opened this issue 1 year ago • 1 comments
trafficstars

In order to listen to two different SQS queues(same aws account) from same springboot application. Can we use one single SqsAsyncClient and have 2 @QueueListener methods or Do we need to follow https://github.com/JaidenAshmore/java-dynamic-sqs-listener/tree/6.x/examples/spring-multiple-aws-a ccount-example even for listening to 2 queues from same account?

satheesh83 avatar Feb 06 '24 22:02 satheesh83

Nah that is only for the case where you have two different AWS accounts. If you are using the same AWS account you can just do the 2 annotations with each pointing to a different queue. Here is an example of that: https://github.com/JaidenAshmore/java-dynamic-sqs-listener/blob/6.x/examples/spring-starter-example/src/main/java/com/jashmore/sqs/examples/MessageListeners.java

JaidenAshmore avatar Feb 06 '24 22:02 JaidenAshmore