开发者

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

is it possible to publish a message fro开发者_如何学JAVAm 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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜