The event handler for the queue

Hi, I must subscribe and process events from the queue (rabbit mq).

Microsoft suggests that in a class startup make an event handler as follows:

var eventBus = app.ApplicationServices.GetRequiredService<IEventBus>();    
eventBus.Subscribe<SomeEvent, SomeEventHandler>();

Do you have a best practice how to do this in the SS to do so as it offers an MS ? :slight_smile:

Thx!

Calling TryResolve<IEventBus> (e.g. in your Service of from IRequest) will resolve the IEventBus dependency that was registered in your .NET Core Appโ€™s ConfigureServices(). You will need to configure your App and register the necessary Rabbit MQ dependencies so youโ€™re able to do this, refer back to the project where you found this source code for how to correctly configure your .NET Core App.

Note this is unrelated to our Rabbit MQ solution.

1 Like