I'm trying to set up RabbitMQ with Spring Cloud Stream Support
I have a couple consumers and producers. One of the producers should produce messages to a separate virtual host on a same RabbitMQ instance (later it might be different physical instances).
application.yaml
spring:
cloud:
stream:
binders:
binder1:
type: rabbit
defaultCandidate: false
inheritEnvironment: false
environment:
spring:
rabbitmq:
host: localhost
port: 5672
virtual-host: virtual-host-1
username: guest
password: guest
binder2:
type: rabbit
defaultCandidate: false
inheritEnvironment: false
environment:
spring:
rabbitmq:
host: localhost
port: 5672
virtual-host: virtual-host-2
username: guest
password: guest
bindings:
test:
binder: binder1
coordinates:
destination: coordinates
binder: binder1
events:
destination: events
binder: binder1
events_output:
destination: events
binder: binder1
tasks:
destination: tasks
binder: binder2
The goal is that binding tasks
should use vhost virtual-host-2
. Other bindings should use vhost virtual-host-1
.
However binder
value seems to be ignored and default rabbit
binder is taken into account with default settings on application startup.
I noticed it while debugging the runtime:
The binder
value on each binding is NULL. Although the value is explicitly provided in properties.
If I set defaultCandidate
of any of the binders to true
then that binder settings will be used as a replacement for default one.
Is something misconfigured?