Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

408
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda