amith
amith

Reputation: 409

Spring AMQP listener with varying queues

I am building a spring boot based application, where it listens to the rabbit. You can pass some command line arguments which will make the application listens to various queues. Is there any way to handle this kind of scenario ?

I am referring to link as example.

Upvotes: 1

Views: 271

Answers (1)

Artem Bilan
Artem Bilan

Reputation: 121177

Try to do like this:

@RabbitListener(queues = "${rabbit.listener.queue}")

and the command line args like:

--rabbit.listener.queue=foo

See @RabbitListener.queues() JavaDocs for more information and Spring Boot Command Line access.

Upvotes: 1

Related Questions