JaidenAshmore / java-dynamic-sqs-listener

Java SQS Listener library built to be customisable and dynamic during runtime
MIT License
51 stars 13 forks source link

Listen to two SQS queue from same springboot app #406

Closed satheesh83 closed 2 days ago

satheesh83 commented 8 months ago

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?

JaidenAshmore commented 8 months ago

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