简体   繁体   English

RabbitMQ + Spring云流:组的使用

[英]RabbitMQ + Spring cloud stream: usage of groups

When using RabbitMQ + Spring cloud stream you can define the following properties in application.properties file: 使用RabbitMQ + Spring云流时,可以在application.properties文件中定义以下属性:

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? 我想“目的地”是指RabbitMQ队列,但是这里的“组”是什么意思?

Thanks! 谢谢!

The destination means topic exchange . destination意味着话题交换 The group means a queue bound to that exchange. group表示绑定到该交换机的队列 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 请参阅文档以获取更多信息: 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

Actually, the destination is the exchange name; 实际上,目的地是交易所名称; the queue someDest.someGroup will be bound to the exchange someDest . 队列someDest.someGroup将绑定到交换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. 如果没有组,该队列将是一个匿名自动删除队列。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM