Publish-Subscribe with Discovery

You can also use the mechanisms of discovery and announcements (presented in Appendix C) to provide yet another way of implementing a publish-subscribe system.

Unlike all the techniques presented thus far for supporting the publish-subscribe design pattern, a discovery-based solution is the only publish-subscribe case that requires no explicit steps by the subscribers or administrator. When utilizing discovery, there is no need to explicitly subscribe either in code or in the config file. In turn, this significantly simplifies the deployment of the system and it enables great volatility in the presence of both publishers and subscribers. You can easily add or remove subscribers and publishers without any additional administration steps or programming.

When taking advantage of discovery for a publish-subscribe system, the subscribers can provide a discovery endpoint so that the publish-subscribe service can discover them, or they can announce their event-handling endpoints, or they can even do both. However, the likelihood of supporting both is low. Announcing subscribers is very much akin to the transient subscribers presented previously. Announcing subscribers is a straightforward way for a running live service instance to receive events. However, unlike transient subscribers management that relies on a fragile list of duplex proxies, susceptible to timeouts and other communication failures, the framework I will present next constructs the proxies ...

Get Programming WCF Services, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.