Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

398
Views
Is there a way to dynamically assign SQS queues to an @SqsListener method implementation, instead of it having to be static?

Currently, from my understanding of these questions (here, and here), in AWS Messaging for Spring Boot, one has to set the queue name or queue url in the @SqsListener annotation definition as a static string that Spring can read on startup. You can't make it a variable, or a list of queues, so that you can define one method and have that one method be the handler for all of those SQS queues.

I have over 40 queues in my application. What I would like to do is take some of those queues, put them into a list, and feed that to the @SqsListener annotation so that I can have one method for those X number of queues, and put a different set of queues Y into another method's annotation. But it doesn't seem like I can do that. Is that right? Is there another way to do this?

I'm starting to not like the implementation of the spring-cloud-aws-messaging maven package, with the @SqsListener annotation on a method that "listens" on a specific queue and calls that method when a new message comes around. Not least of which because it forces me to use 1.0 of the AWS Java SQS SDK, rather than be able to use 2.0. I'd rather manage the polling myself in spring somehow, but Idk how to do that. How can I poll a list of SQS queues in Spring Boot? I would like it if I can just configure it to long poll for like 20 seconds (the max according to AWS) and if it finds a message, it returns it and starts the next poll. Is this possible?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!