Created
February 25, 2018 11:05
-
-
Save umit/878807b3c7180454eb56cbd0cd2bcbd4 to your computer and use it in GitHub Desktop.
Queue binding from AmqpAdmin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Bean | |
public InitializingBean prepareQueues(AmqpAdmin amqpAdmin) { | |
return () -> { | |
Queue queue = new Queue("QUEUE_NAME", true); | |
DirectExchange exchange = new DirectExchange("QUEUE_NAME"); | |
Binding binding = BindingBuilder.bind(queue).to(exchange) | |
.with("QUEUE_NAME"); | |
amqpAdmin.declareQueue(queue); | |
amqpAdmin.declareExchange(exchange); | |
amqpAdmin.declareBinding(binding); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment