Implementations of EIP message routing patterns
C#
Latest commit 46bde57 Dec 16, 2016 @jbogard committed on GitHub Merge pull request #5 from SimonCropp/master
add icon
Permalink
Failed to load latest commit information.
src add icon Dec 9, 2016
.gitattributes Create .gitattributes Feb 2, 2013
.gitignore Ignoring nuget packages May 7, 2013
README.md add icon Dec 9, 2016
license.txt add mit license Dec 9, 2016
package_icon.png add icon Dec 9, 2016

README.md

Icon

NServiceBus.MessageRouting

Implementations of EIP message routing patterns for NServiceBus

Currently the patterns implemented include the routing slip. Planned are a true saga implementation (w/ compensating actions) and more.

Routing Slips

The Routing Slip pattern enables you to route a message to one or more destinations. Each step handles the message and forwards to the next step.

Forwarding is transparent to each handler, nor does each handler need to have any additional configuration for other steps.

To enable in each endpoint, configure routing slips in your EndpointConfiguration:

configuration.EnableFeature<RoutingSlips>();;

Then kick off the process by sending a message and including the list of destinations, either from an IPipelineContext inside a message handler or IMessageSession from your endpoint instance:

// From your endpoint instance
endpoint.Route(order, new[] {"Validate", "Fraud", "CreditCheck", "Process"});

// Inside a message handler
context.Route(order, new[] {"Validate", "Fraud", "CreditCheck", "Process"});

Each endpoint needs to include a handler for the message. Optionally, each endpoint can inspect/modify routing slip attachments:

context.Extensions.Get<RoutingSlip>().Attachments["FraudResult"] = "Declined";

Routing slip attachments are data that you share between different handlers in the route steps. As the message flows from step to step, the original raw transport message is passed through as-is.

That's all there is to it!

Icon

Route designed by Steven Lester from The Noun Project