NOTE: anonymous groups are essential for Spring Cloud Bus to work properly.
using a group makes
a) the subscription durable which means that apps will receive all events (including the ones that have been sent while they were not running)
b) using groups means that apps can become competing consumers which means that the events are not broadcast
c) queues are not deleted automatically anymore
The destination you set in spring-cloud-bus
inbound/outbound channels are the rabbitmq exchanges not the queues.
For spring-cloud-bus
the outbound channel name is springCloudBusOutput
.
Hence, your configuration needs to be:
spring:
cloud:
stream:
bindings:
springCloudBusOutput:
destination: testExchange
Here the destination name testExchange is the exchange name not the queue
name.
To avoid anonymous
name in the queue, you can set a group
name for inbound
channel binding.
spring:
cloud:
stream:
bindings:
springCloudBusInput:
destination: testExchange
group: testQueue
This will make the queue name testExchange.testQueue