NServiceBus How To Publish Message From 2 Physical Locations Of 1 Logical Service

可紊 提交于 2019-12-06 16:33:32

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:

  1. The subscription request (as defined in your subscriber's application configuration file) is sent to an endpoint of the publisher.
  2. The publisher adds the request to its subscription store which is often a relational database.
  3. If the database is shared/replicated all publisher endpoints will know about the new subscriber.
  4. All publisher endpoints will be able to publish and the subscriber will be able to receive the desired message.

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.

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().

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!