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 RabbitAdmin

RabbitAdmin is used to declare the exchanges, queues, and binding that needs to be ready on startup. RabbitAdmin does the automatic declaration of the queues, exchanges, and binding. The main benefit of this auto-declaration is that if the connection is disconnected for some reason, they will be applied automatically when the connection is re-established. The following code configures RabbitAdmin:

@Beanpublic RabbitAdmin rabbitAdmin() {    RabbitAdmin admin = new RabbitAdmin(connectionFactory());    admin.declareQueue(queue());    admin.declareExchange(exchange());    admin.declareBinding(exchangeBinding(exchange(), queue()));    return admin;}

rabbitAdmin() will declare the Queue, Exchange, and Binding. The RabbitAdmin constructor ...

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