Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

399
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda