英文:
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).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论