java spring boot配置:

//具体参看了配置的源码
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

 

参见:

https://github.com/spring-projects/spring-boot/blob/v2.1.5.RELEASE/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java

 

相关文章:

  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
  • 2021-12-29
  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
  • 2021-10-20
猜你喜欢
  • 2022-01-03
  • 2021-12-18
  • 2021-06-06
  • 2021-12-16
  • 2021-10-04
  • 2021-11-09
相关资源
相似解决方案