I want to be able to write custom middleware for Rebus which will wrap around message handlers: executing before and after each handler, regardless of the message type. Is this possible with Rebus, and if so, how do I do that?
Browsing the source code of Rebus, I think it should be possible, as the library is very neatly built around the concept of IPipeline with customizable "steps". But although it looks like it should be easy to add custom steps, I cannot find any public API exposing the pipline. Is this possible to modify the pipeline from the client code?
What I am looking for is essentially an equivalent to MassTransit's IFilter<>. We are about to choose between MassTransit and Rebus (or possibly a custom implementation on top of Microsoft.Azure.ServiceBus) for a new project, and at this moment this looks like a major feature missing from Rebus.