简体   繁体   English

我可以使用spring.cloud.stream.bindings吗? <channel> .group何时使用RabbitMQ获得一次准确的交货?

[英]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.

相关问题 属性 spring.cloud.stream.bindings 有什么用。<channelname> .consumer.partitioned</channelname> - what is the use of the property spring.cloud.stream.bindings.<channelName>.consumer.partitioned 如何在不同的RabbitMQ虚拟主机上为Spring Cloud Stream Binding设置Binders - How to set Binders for Spring Cloud Stream Bindings on different RabbitMQ vhosts 使用spring-cloud-stream发送rabbitmq消息时无法指定发送的RoutingKey - When I use spring-cloud-stream to send rabbitmq messages, I cannot specify the RoutingKey sent 切换到“exactly-once”投放策略后如何避免“failed to send operations”错误? - How to avoid "failed to send operations" errors after switching to the "exactly-once" delivery strategy? Spring 云 stream - RabbitMQ 配置 - Spring cloud stream - RabbitMQ configuration Java - 是否可以使用 Spring 云 Stream Kafka 和 Z7EAA993723E38008DD81C2F4D7985ECF6E0CE8AF1D1Z 用于相同的应用程序13E57B3BFC9Z92 - Java - Is it Possible to Use Spring Cloud Stream Kafka and RabbitMQ for the Same Application Spring 云 Stream 与 RabbitMQ 连接 - Spring Cloud Stream connection with RabbitMQ 如何更改 Spring Cloud Stream 配置中所有 RabbitMQ 消费者的默认恢复间隔? - How can I change default recovery interval for all RabbitMQ consumers in Spring Cloud Stream configuration? RabbitMQ(或Spring云流)可以独占消息吗? - Can RabbitMQ (or spring cloud stream) consume messages exclusively? 如何指定使用 Spring Cloud Stream 向 RabbitMQ 发送消息的超时时间? - How to specify timeout for sending message to RabbitMQ using Spring Cloud Stream?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM