rebus-org / Rebus.Events

:bus: Convenient event configuration extensions for Rebus

Home Page:https://mookid.dk/category/rebus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rebus.Events

install from nuget

Provides configuration extensions that allow for easily hooking into Rebus in various places.

Here is how you would add custom headers to all outgoing messages:

Configure.With(...)
    .(...)
    .Events(e =>
    {
        e.BeforeMessageSent += (bus, headers, message, context) =>
        {
            headers["x-custom-header"] = "wohoo";
        };
    });

The following events are available:

  • BeforeMessageSent: Raised before each message is sent, allowing for mutating the message and even replacing it with something else if you want
  • AfterMessageSent: Raised after each message has been sent (or added to the transaction's list of outgoing messages)
  • BeforeMessageHandled: Raised before an incoming message is dispatched to handlers
  • AfterMessageHandled: Raised after an incoming message is dispatched to handlers
  • more to come

About

:bus: Convenient event configuration extensions for Rebus

https://mookid.dk/category/rebus

License:Other


Languages

Language:C# 91.0%Language:Batchfile 9.0%