Stream Cloud Stream 多rabbitmq实例配置问题

org.springframework.context.ApplicationContextException: Failed to start bean 'outputBindingLifecycle'; nested exception is java.lang.IllegalStateException: A default binder has been requested, but there is more than one binder available for 'org.springframework.integration.channel.DirectChannel' : local_rabbit,local_rabbit1, and no default binder has been set.
  错误解决

 

Stream Cloud Stream 多rabbitmq实例配置问题:

解决方法:

 

spring.cloud.stream.binders.local_rabbit.type=rabbit

spring.cloud.stream.binders.local_rabbit.environment.spring.rabbitmq.host=192.168.10.126

spring.cloud.stream.binders.local_rabbit.environment.spring.rabbitmq.port=5672

spring.cloud.stream.binders.local_rabbit.environment.spring.rabbitmq.username=admin

spring.cloud.stream.binders.local_rabbit.environment.spring.rabbitmq.password=rabbit

spring.cloud.stream.binders.local_rabbit.environment.spring.rabbitmq.virtual-host=/

 

spring.cloud.stream.binders.local_rabbit1.type=rabbit

spring.cloud.stream.binders.local_rabbit1.environment.spring.rabbitmq.host=192.168.10.117

spring.cloud.stream.binders.local_rabbit1.environment.spring.rabbitmq.port=5672

spring.cloud.stream.binders.local_rabbit1.environment.spring.rabbitmq.username=admin

spring.cloud.stream.binders.local_rabbit1.environment.spring.rabbitmq.password=rabbit

spring.cloud.stream.binders.local_rabbit1.environment.spring.rabbitmq.virtual-host=/

#重点,一定要设置一个默认binder,否则启动会报错

spring.cloud.stream.default-binder=local_rabbit1

 

 

你可能感兴趣的:(资讯)