StreamBridge与响应式绑定器

huangapple go评论47阅读模式
英文:

StreamBridge with reactive binder

问题

The Stream bridge 可以安全与 Kafka ReactiveBinder 一起使用吗?下面的方法返回一个 boolean,而不是 Mono<Boolean>。因此有这个问题..!

streambridge.send(...)

文档 表示,如果消息发送成功,它会返回 true,听起来像是"阻塞"的。

英文:

Spring Team,

Is the Stream bridge safe to use along with Kafka ReactiveBinder? The below method returns a boolean. Not a Mono<Boolean>. Hence this question..!

streambridge.send(...)

The doc says, it returns true if the message was sent successfully. sounds like "blocking"

答案1

得分: 2

是的,它是安全的。

这个结果只是表示将消息发送到目标通道成功;即使是对于非响应式的绑定器(比如RabbitMQ和Kafka MessageChannel绑定器),实际的发送是异步的,不会阻塞。

只有在底层通道是可能阻塞的类型时,才会返回false,比如具有未处理消息上限的QueueChannel(通常情况下几乎不会出现这种情况,无论使用哪种类型的绑定器)。

英文:

Yes, it's safe.

The result simply means that the send to the target channel was successful; even with non-reactive binders (such as RabbitMQ, and the Kafka MessageChannel binder), the actual send is async. It won't block.

It can only return false if the underlying channel is a type that can block, such as a QueueChannel with an upper bound of unprocessed messages (which is generally never the case, for any type of binder).

huangapple
  • 本文由 发表于 2023年5月10日 23:11:08
  • 转载请务必保留本文链接:https://go.coder-hub.com/76220074.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定