Handler ordering by interface

Component: Handler ordering by interface
NuGet Package NServiceBus.HandlerOrdering (1.1-pre)
This is a community run project
Target NServiceBus Version: 7.x
This page targets a pre-release version and is subject to change prior to the final release.

Configuring to use HandlerOrdering

endpointConfiguration.ApplyInterfaceHandlerOrdering();

Expressing dependencies

MessageHandler1 wants to run after MessageHandler3

public class MessageHandler1 :
    IHandleMessages<MyMessage>,
    IWantToRunAfter<MessageHandler3>
{

MessageHandler2 wants to run after MessageHandler1

public class MessageHandler2 :
    IHandleMessages<MyMessage>,
    IWantToRunAfter<MessageHandler1>
{

Resulting execution order

  1. MessageHandler3
  2. MessageHandler1
  3. MessageHandler2

Last modified