[英]Using Spring Cloud Streaming, how to send messages to binder synchronously?
I'm building a cloud stream application using Spring with Azure Event Hub and Service bus.我正在使用 Spring 和 Azure 事件中心和服务总线构建云 ZF7B44CFFAFD5C52223D5498196C8A2E7BZ 应用程序。 In my use case I'm trying to achieve the following functionality:
在我的用例中,我试图实现以下功能:
The question is, does the message sending is sync or async?问题是,消息发送是同步的还是异步的? Will it wait until all messages sent in step A before executing the next steps?
它会等到步骤 A 中发送的所有消息之后再执行后续步骤吗?
To make sure the message production happens synchronously you can simply set the spring.cloud.stream.eventhub.bindings.<channel-name>.producer.sync
property to true
.为了确保消息生产同步发生,您只需将
spring.cloud.stream.eventhub.bindings.<channel-name>.producer.sync
属性设置为true
。
The related documentation can be found here .相关文档可以在这里找到。
You can see the property referenced in the code here and here .您可以在此处和此处查看代码中引用的属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.