Is there a way on Rebus of executing an action before the IHandleMessages.Handle is called?
Particulary I want to set a correlation id of my logs for log4net and I'm having really difficult times to get this working.
I have an activity pattern converter to get a Guid from
System.Diagnostics.Trace.CorrelationManager.ActivityId = Guid.NewGuid()
But I want to be able to set this before each handle is activated. I'm using Autofac as container with Rebus
An easy and convenient way to achieve this would be to include the Rebus.Events package, which allows for setting up an event delegate to be invoked before each message is handled like this: