How to configure RabbitMQ connection with spring-rabbit?

The application for that guide is a Spring Boot Application.

Add a file application.properties to src/main/resources.

You can then configure rabbitmq properties according to the Spring Boot Documentation – scroll down to the rabbitmq properties…

...
spring.rabbitmq.host=localhost # RabbitMQ host.
...
spring.rabbitmq.password= # Login to authenticate against the broker.
spring.rabbitmq.port=5672 # RabbitMQ port.
...
spring.rabbitmq.username= # Login user to authenticate to the broker.
...

To connect to a cluster, use

spring.rabbitmq.addresses= # Comma-separated list of addresses to which the client should connect.

e.g. server1:5672,server2:5672.

If you don’t want to use boot auto configuration, declare a CachingConnectionFactory @Bean yourself and configure it as desired.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)