O'Reilly logo

Hands-On High Performance with Spring 5 by Dinesh Radadiya, Prashant Goswami, Pritesh Shah, Subhash Shah, Chintan Mehta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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:

@BeanBinding 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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required