使用 Service Brokers 同时向两个服务发送消息
我可以使用服务代理将消息从一项服务发送到多项服务吗?
类似
BEGIN DIALOG CONVERSATION @dialog_handle
FROM SERVICE [SERVICE1]
TO SERVICE 'SERVICE2',**'SERVICE3'**
ON CONTRACT [MainContract]
查看语法,我认为我们无法做到这一点。还有什么选择呢?
感谢和问候
DEE
could I send messages from one service to multiple service using service brokers?
Something like
BEGIN DIALOG CONVERSATION @dialog_handle
FROM SERVICE [SERVICE1]
TO SERVICE 'SERVICE2',**'SERVICE3'**
ON CONTRACT [MainContract]
Looking at the syntax, I do not think we could do this. What's the alternative?
Thanks and Regards
DEE
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Service Broker 中没有内置发布-订阅或多播功能。要将消息发送到多个服务,您必须通过单独的对话框将其显式发送到每个目的地。
典型的解决方案是仅从应用程序向充当分发者的服务发送一条消息。分发者服务接收此消息并将其副本发送到每个感兴趣的服务(Service2、Service3 等)。这样,应用程序不需要预先知道需要将消息发送到多少个服务,它只需将消息发送到分发服务。
There is no publish-subscribe nor multicast built in into Service Broker. To send a message to multiple services you have to explicitly send it to each destination an o a separate dialog.
The typical solution is to send only one message from the application to a service that acts like a distributor. The distributor service receives this message and sends a copy of it to each interested service (Service2, Service3 etc). This way the application doesn't need to know upfront how many services it needs to send the message to, it just sends it to the distributor service.