Routing Patterns Made Easy with WCF 4 Rick G. Garibay
[email protected] http://rickgaribay.net Twitter: @rickggaribay
About Me • • • •
Solutions Architect at Neudesic Microsoft MVP, Connected Systems Microsoft Connected Technology Advisor President, Co-Founder Phoenix Connected Systems User Group (PCSUG) • Nearly 12 years professional experience developing Microsoft solutions across industry verticals
Other Conference Sessions • Interoperable Discovery with WCF 4 • WCF 4: File, New Project, Code, F5 • Making Software + Services Tenable with the Windows Azure AppFabric Service Bus • Much More!
• http://www.vconferenceonline.com/shows/spring10/uvc/sess ions.asp
Agenda • • • • •
Configuring the Routing Service Basic Routing Support for Virtual Services Multicasting Redundant routing
Integration Patterns • • • • • • • • •
High Availability Virtual Endpoint Publish-Subscribe Mediation Correlation Routing Protocol Bridging Multicast Messaging Orchestration
Twiter: @rickggaribay
Exploring Integration Patterns • • • • • • • • •
High Availability Virtual Endpoint Publish-Subscribe Mediation Correlation Routing Protocol Bridging Multicast Messaging Orchestration
Twiter: @rickggaribay
Routing Contracts
SimplexDatagramRouter • SessionMode = SessionMode.Allowed • AsyncPattern = true • IsOneWay = true • IInputChannel -> IOutputChannel
ISimplexSessionRouter
IRequestReplyRouter
• SessionMode = SessionMode.Required • AsyncPattern = true • IsOneWay = true • IInputSessionChannel -> IOutputSessionChannel
• SessionMode = SessionMode.Allowed • AsyncPattern = true • IReplyChannel -> IRequestChannel
IDuplexSessionRouter • SessionMode=SessionMo de.Required • CallbackContract=typeof( ISimplexSession) • AsyncPattern = true • IsOneWay = true • TransactionFlow(Transact ionFlowOption.Allowed) • IDuplexSessionChannel
Virtual Endpoint • Scenario: • I want to expose a virtual endpoint so that my consumers aren’t aware of the actual endpoint. • Why? • Flexibility. I can change my service without affecting my clients. I am also free to modify the flight path of the message or the message itself based on external logic or events.
Twiter: @rickggaribay
Virtual Endpoint
Client http://bar
http://foo
Router
Twiter: @rickggaribay
Service
Client Configuration
Routing Service Configuration – Client Endpoint
Routing Service Configuration – Filters & Filter Tables
Hosting the RoutingService in IIS 7 WAS Supporting Virtual Services/Service Aggregation
DEMO
Twiter: @rickggaribay
Multicast Messaging • Scenario: • I want to expose a virtual endpoint so that my consumers aren’t aware of the actual endpoints and I want multiple services to receive a copy of the message.
• Why? • Multiple services may be interested in a message or event (subscribers). In more sophisticated scenarios, transformation and routing rules might be applied to determine recipients dynamically.
Twiter: @rickggaribay
Multicast Messaging
Client http://bar
http://foo
Service
Router http://baz
http://bif
Twiter: @rickggaribay
Service Service
Routing Configuration – Client Endpoints
Routing Configuration – Filters & Filter Tables
Multicasting
DEMO
Twiter: @rickggaribay
High Availability • Scenario: • I want to ensure that a redundant service(s) is available in the event that a service goes down. • Why? • Services can come and go. Providing a back up service or list of services to distribute workload and provide high availability is key to a robust service-oriented architecture.
Twiter: @rickggaribay
High Availability
Client http://bar
http://foo
Service
Router http://baz
http://bif
Twiter: @rickggaribay
Service Service
Routing Configuration – Client Endpoints
Routing Configuration – Filters & Filter Tables
Redundant Services
DEMO
Twiter: @rickggaribay
Much More • • • • • • •
Implementing a Managed Discovery Proxy Content-based correlation Context-based correlation Protocol mediation Version mediation Priority Routing Workload distribution
Twiter: @rickggaribay
Thank You • Routing Service on MSDN: http://msdn.microsoft.com/enus/library/ee517423(VS.100).aspx • A Developer's Introduction to Windows Communication Foundation 4: http://msdn.microsoft.com/enus/library/ee354381.aspx • Join me for a live chat on Wed, 4/7 at 12 pm • The conversation continues on twitter: @rickggaribay #sswug10wcf4
Twiter: @rickggaribay
Routing Patterns Made Easy with WCF 4 Rick G. Garibay
[email protected] http://rickgaribay.net Twitter: @rickggaribay