3

I have load balanced web servers, that with the existing code base, handles when a user logs into the site. I would like to send a broadcast message to any applications that have subscribed saying 'hey x logged in' ? So have many web servers and many applications subscribing.

How does discovery work/configuration work with nservicebus ? Should each application know about each web server and subscribe individually or is this where the distributer comes in, so web servers all send to the 1 distributer and all application subscribe to single distributer and the distributer relays the message ?

I've tried to research this, but having troubles.

Thanks

MrT

Mrt
  • 73
  • 4

1 Answers1

3

First, see the guidance about publishing a message from a web application (or more specifically, about NOT publishing a message from a web application).

Taking all that in consideration, I would recommend your webservers Send() a message to a central event aggregator, which could then Publish() events that other applications (or your web applications) could subscribe to.

More specifically:

  • MyWeb on Webserver1 (with input queue MyWeb@Webserver1) Send()s a UserChangeMessage to queue WebEventBroker@CentralServer
  • WebEventBroker app, running on CentralServer, with input queue WebEventBroker@CentralServer, receives UserChangeMessage, and publishes UserChangedEvent
  • The MyWeb application subscribes to events of type UserChangedEvent, so when it is published, it is received by queues MyWeb@Webserver1 and MyWeb@Webserver2 where both web applications can process the message and take appropriate action.
Simon
  • 33,714
  • 21
  • 133
  • 202
David Boike
  • 18,545
  • 7
  • 59
  • 94
  • Does the event broker need to be a distributor ? I can't get this working. Any chance you can provide sample configs ? – Mrt May 27 '10 at 10:27