[英]Can I use spring.cloud.stream.bindings.<channel>.group when using RabbitMQ to obtain exactly-once delivery?
so I was reading this tutorial to configure RabbitMQ and SpringBoot. 所以我在阅读本教程来配置RabbitMQ和SpringBoot。
At a certain point it is said: 在某种意义上说:
Most of the time, we need the message to be processed only once. 在大多数情况下,我们只需要处理一次消息。 Spring Cloud Stream implements this behavior via consumer groups. Spring Cloud Stream通过使用者组实现了此行为。
So I started looking for more information on Spring docs it is written that: 因此,我开始寻找有关Spring文档的更多信息,其内容如下:
When doing so, different instances of an application are placed in a competing consumer relationship, where only one of the instances is expected to handle a given message. 这样做时,会将应用程序的不同实例置于竞争的消费者关系中,在该消费者关系中,只有一个实例可以处理给定消息。
Spring Cloud Stream models this behavior through the concept of a consumer group. Spring Cloud Stream通过消费者群体的概念对这种行为进行建模。 (Spring Cloud Stream consumer groups are similar to and inspired by Kafka consumer groups.) (Spring Cloud Stream用户组与Kafka用户组相似并受其启发。)
So I setup here two nodes with Spring Boot Cloud Stream and RabbitMQ and using spring.cloud.stream.bindings.<channel>.group
. 所以我在这里使用Spring Boot Cloud Stream和RabbitMQ并使用spring.cloud.stream.bindings.<channel>.group
设置了两个节点。
This to me still looks like at-least-once behavior. 在我看来,这至少是一次行为。 Am I wrong in assuming that? 我认为那是错误的吗? Should I still manage the possibility to process a message twice even using spring.cloud.stream.bindings.<channel>.group
? 即使使用spring.cloud.stream.bindings.<channel>.group
我是否仍应管理两次处理消息的可能性?
Thank you 谢谢
It's at least once. 至少一次。 The connection might close before the ack is sent. 发送确认之前,连接可能已关闭。 Rare, but possible. 稀有,但可能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.