NServiceBus determines the execution order of handlers

Just wondering, can this indicate the start order of the handler (AuthorizationHandler) before everyone else?

public void SpecifyOrder(Order order)
{
    order.Specify(First<AuthorizationHandler>.Then<IHandleMessages<IMessage>>());
}

It seems weird to add Then<IHandleMessages<IMessage>>().

Is there a better way to tell the handler x to execute the bus before all the others?

+3
source share
1 answer

Specifying the order of the message handler does not require you to list everything that could happen, only the message handlers that should receive priority. I think in your case this will be enough:

public void SpecifyOrder(Order order)
{
    order.Specify<AuthorizationHandler>();
}

- , . , .

+4

Source: https://habr.com/ru/post/1745704/


All Articles