Thursday, June 30, 2011

WCF Service Routing Resources

Service routing is used to expose an end-point to consumers that appears as though it is the real service, but actually is routing requests elsewhere. Reasons to do this include: version based routing (older versions go to a different service), or application level load balancing, or protocol bridging, or dynamic message content based routing etc.

Here are some resources in relation to WCF Service routing:

Wednesday, June 29, 2011

WCF Performance Comparison

A Performance Comparison of Windows Communication Foundation (WCF) with Existing Distributed Communication Technologies

WCF Network Load Balancing Resources

Useful Pages I have found while researching this topic:
Most information refers to the use of external software (mostly Microsoft NLB - part of 2008 Server), or hardware appliances that preface service interfaces.
There seems to be three options:
  1. Utilise external hardware or software NLB'ers. (This is noted by Microsoft as the best practise approach).
  2. Manually partition your clients so that they hard wired to point to one of service instances. This approach doesn't give good balance but its straight forward in some simple instances.
  3. Hand craft discovery and balancing code inside your application. This gives the widest fail over options and balancing flexibility. The significant downsides are the workload to develop, and runtime hosting training and maintenance.

    Tuesday, June 28, 2011

    WCF Extensibility Resources

    A great article in a old MSDN magazine explaining the most common extensibility points in WCF.

    Extending WCF with custom behaviors

    Overview:
    There are essentially 5 common points of extensibility in a WCF service (and the corresponding interface to use):
    1. Message inspection (IDispatchMessageInspector)
    2. Operation selector (IDispatchOperationSelector)
    3. Message formatter (deserialisation) (IDispatchMessageFormatter)
    4. Parameter Inspection (IParameterInspector)
    5. Operation Invoker (IOperationInvoker)
    These extender classes are injected into WCF using Behaviors. Options are:
    Ensure any implementation of these interfaces also inherits Attribute to allow direct decoration of a contract/operation within code.

    Wiring is best done with config or attribute use:
    <behaviors>
    <serviceBehaviors>
    <behavior name="Default">
    <serviceMetadata httpGetEnabled="true"/>
    <consoleMessageTracing/>
    </behavior>
    </serviceBehaviors>
    </behaviors>
    [ServiceContract]
    public interface IZipCodeService
    {
    [ZipCodeCaching]
    [ZipCodeValidation]
    [OperationContract]
    string Lookup(string zipcode);
    }