3
votes

When using RabbitMQ + Spring cloud stream you can define the following properties in application.properties file:

spring.cloud.stream.bindings.input1.destination=someDest
spring.cloud.stream.bindings.input1.group=someGroup

I guess that "destination" means the RabbitMQ queue, but what does it mean "group" here?

Thanks!

2

2 Answers

3
votes

The destination means topic exchange. The group means a queue bound to that exchange. So, several apps may subscribe to the same destination and get the same message if they use different groups. If group is the same, only one consumer instance it going to get one message.

See documentation for more info: http://cloud.spring.io/spring-cloud-static/spring-cloud-stream-binder-rabbit/2.1.0.RC4/single/spring-cloud-stream-binder-rabbit.html#_rabbitmq_binder_overview

2
votes

Actually, the destination is the exchange name; the queue someDest.someGroup will be bound to the exchange someDest.

When a group is provided, multiple instances of the app will compete for messages.

If there is no group, the queue will be an anonymous auto-delete queue.