2

I would like to create rabbitmq queues everytime my Spring Boot application starts (if queues don't exists already).

In the current architecture, we manually create durabl queues using rabbitmq admin. But we want our application, to detect new queues in the configuration and create durable ones if they don't exist

1

1 Answer 1

2

That is built-in feature of Spring AMQP:

The AMQP specification describes how the protocol can be used to configure Queues, Exchanges and Bindings on the broker. These operations which are portable from the 0.8 specification and higher are present in the AmqpAdmin interface in the org.springframework.amqp.core package.

Since amqpAdmin bean is auto-configured by Spring Boot, you only need to declare particular @Beans for Queues, Exchanges and Bindings between them.

6
  • need an example, since mine doesnt create Nov 8, 2019 at 18:13
  • 1
  • somewhere I read you have to create RabbitAdmin bean explicitely? I dont create it and right now my queues are not created automatically Nov 8, 2019 at 18:19
  • 1
    Please, pay attention that this question is about Spring Boot, which auto-configure a RabbitAdmin for you. Otherwise, please, follow the mentioned docs and explicitly declare bean for it. Anyway this turns out to its own SO thread... Nov 8, 2019 at 18:21
  • 1
    I think you also use Cloud Connectors which seems for me disable Spring AMQP auto-configuration. Therefore a RabbitAdmin should be created explicitly. Nov 8, 2019 at 18:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.