Skip to content

Instantly share code, notes, and snippets.

@umit
Created February 25, 2018 11:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save umit/878807b3c7180454eb56cbd0cd2bcbd4 to your computer and use it in GitHub Desktop.
Save umit/878807b3c7180454eb56cbd0cd2bcbd4 to your computer and use it in GitHub Desktop.
Queue binding from AmqpAdmin
@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