Douglas Purdy

Model-Driven Content Based Routing

with 4 comments

I tweeted this, but I think it deserves a full post.  This a great example that leverages many of the different aspects of SQL Server Modeling (”M”-based DSLs, “M”, Modeling Services, etc.) to enable a better experience around application development/management.

One of the major new WCF features in .NET 4 is the Routing Service which is a configurable WCF-based service that supports content-based routing and protocol bridging. The content based routing capability in .NET 4 allows for WCF to perform message filtering based on content contained in either the SOAP headers or within the message body. For instance, if a company has two different versions of the same service deployed, the client application can call into a central routing service. The routing service can then forward the message to the correct backend service based on information it extracts from the incoming message, such as version number. The routing service also supports error handling routing that can automatically resend the message to another destination endpoint in the event of an error.

Unfortunately, the default routing service is not the easiest to manage or configure. Fortunately, the recently released SQL Server Modeling CTP makes it easy to build model driven application and the .NET 4 router configuration is a good modeling candidate. As such, the RouterManager sample which is available for download from MSDN Code Gallery, shows how this can be accomplished using Visual Studio 2010 Beta 2 and the SQL Server Modeling CTP which was released in conjunction with PDC09. This is the first in a series of articles that will cover the architecture and concepts used in the RouterManager sample application to create a fully model driven content based router.

The SQL Server Modeling CTP can be used to create a domain specific language (DSL) that can make the routing configuration of the WCF routing service much simpler. This is accomplished by first defining a language that is human readable, which will provide IT Operations and others within an organization who are not expert developers with an easier way to interact with applications. The CTP’s modeling language features make it easy to define the structure of the configuration data in a human readable representation that can be shared within an application’s modules, tiers and tools or between even between applications. Also included, as part of the CTP, is the SQL Server Modeling Services, which provides functionality to store, access and share both the physical and metadata representation of the model. The Modeling CTP also provides a visual tool called “Quadrant” for viewing and interacting with models and model data.

http://blogs.msdn.com/dmcat/archive/2009/11/16/model-driven-content-based-routing-using-sql-server-modeling-ctp-part-i.aspx

December 6th, 2009 at 1:46 am

4 Responses to 'Model-Driven Content Based Routing'

Subscribe to comments with RSS or TrackBack to 'Model-Driven Content Based Routing'.

  1. [...] Purdy posts Model-Driven Content Based Routing. The sample includes a DSL, a Runtime and more This a great example that leverages many of the [...]

  2. Hello Douglas,
    I am only just starting to learn SQL Server Modeling, but am looking forward to it. One question that I have is as follows: “M” can obviously be used to model a sophisticated database, and I wanted to ask whether or not there is any way for me to read and process the metadata in an “M” file like that e.g. If I could read the metadata in an “M” file, then I could generate XAML files and C# code with validation logic based on the metadata.
    Many thanks, Bruce.

    Bruce Raggett

    9 Dec 09 at 10:37

  3. @Bruce

    Yes, you can. We are starting to do this for you, however, in terms of validation metadata on the generate ef classes. Our goal is that you can model your business domain completely in “M”. We see how much of that we can nail in v1.

    douglasp

    10 Dec 09 at 18:16

  4. [...] language to reduce project information into data models for efficient editing and deployment. This blog post by Douglas Purdy, a Microsoft software architect, does a good job explaining the power of SQL [...]

Leave a Reply