NServiceBus 如何从 1 个逻辑服务的 2 个物理位置发布消息
是否可以从部署到 2 个物理位置的 1 个逻辑服务发布消息?
配置文件会是什么样子? 您不能在订阅者中添加消息两次。但如果您想订阅 2 个队列,则必须这样做。
is it possible to publish a message from 1 logical service that is deployed to 2 physical locations?
how would the config file look like?
you cannot add a message in your subscriber 2 times. but you must if you want to subscribe to 2 queues.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,这很有可能。我们现在正在做。诀窍是拥有共享或复制的订阅存储。其工作原理如下:
Yes, it's very possible. We're doing it right now. The trick is to have either a shared or replicated subscription store. Here's how it works:
这正是数据库订阅存储要解决的问题。只需将两个物理发布者配置为共享相同的 sub.db 就可以了。然后让您的订阅者订阅其中之一。
That is excactly what the db subrcription storage is meant to solve. Just configure both physical publishers to share the same sub.db and you should be fine. Then have your subscribers subscribe to one of them.
我相信这是不可能的。不管怎样,你在中间安排了某种调度员。
发布者使用 IBus.Send() 将消息直接发送到调度程序,调度程序又使用 IBus.Publish() 进行发布。
I believe this is not possible. Anyway you cvan you some kind of dispatcher in the middle.
The Publisher send the Message directly to the dispatcher using IBus.Send() which in turn publishs using IBus.Publish().