Configuring a binding

Now, we need to create a binding using the BindingBuilder class to connect queue to Exchange. The following code is used to create a binding:

@Bean
Binding exchangeBinding(DirectExchange directExchange, Queue queue) {
return BindingBuilder.bind(queue).
to(directExchange)
.with(ROUTING_KEY);
}

The exchangeBinding() method creates a binding of queue and Exchange with the ROUTING_KEY routing key value.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset