1. 程式人生 > >Spring Boot項目配置RabbitMQ集群

Spring Boot項目配置RabbitMQ集群

user spa 配置 per work number host nbsp onf


//具體參看了配置的源碼
org.springframework.boot.autoconfigure.amqp.RabbitProperties


//RabbitMQ單機
spring:
  rabbitmq:
    host: localhost
    port: 5672
    username: your_username
    password: your_password

//或者  RabbitMQ單機,只使用addresses
spring:
  rabbitmq:
    addresses:ip1:port1
    username: your_username
    password: your_password


//RabbitMQ集群,addresses一定要逗號分隔
spring:
  rabbitmq:
    addresses:ip1:port1,ip2:port2,ip3:port3
    username: your_username
    password: your_password

Spring Boot項目配置RabbitMQ集群