Forwarding Service, Part 1
I saw that Jesus Rodriguez talked about the forwarding service that was included in the Dublin PDC preview so I thought I'd talk a little bit about what motivated the creation of this service and how I think it might be used.
The idea of shipping a general-purpose router with WCF is something that we've tossed around for a long time. It's relatively common when building distributed applications to need application-level routing. Having a router included in WCF would allow people to include a router as a building block in their applications without forcing everyone to write the routing logic themselves. Although a router is conceptually simple, there's some tricky logic needed when routing certain kinds of messages, particularly if you want to support concepts such as sessions. It also takes a certain level of sophistication to build an asynchronous router implementation so that you can use the router in high-scale and high-throughput scenarios.
Putting a router into the product for Indigo ended up not happening. However, we did get to ship a simple router implementation as the intermediary router sample in the SDK. The code for that router sample originally came from a partner demo that Kenny Wolf put together. We later decided to convert the code into a sample and wrote the introductory readme to explain how the router worked.
After Indigo shipped I still wanted to find some way of including a router in the product in the future. There were a few requirements that I had in mind for what it meant to be a high-quality application-level router.
-
Single source, multiple destination routing
-
Works with all different kinds of bindings, channel shapes, and message shapes
-
Low latency and memory overhead
-
Routing decision based on any part of the message content
-
Supports advanced messaging features, such as sessions and transactions
-
Transforms channels and messages based on the routing decision
-
Copes with delivery failures while routing
-
Requires no code to add a router to an application
The forwarding service that was included in the PDC preview hasn't met all of these requirements yet but I think it's complete enough that you can get a good sense of how a canned router service might be used. Next time I'll continue describing the capabilities of the forwarding service and what it might look like when it's done.