I am struggling to understand when to use each of these:
1) Message Bus: Used to send integration events between Microservices. For example, Microservice A could publish an integration event, which is handled by Microservice B and Microservice C. The benefit of a Message Bus e.g. RabbitMQ is that it could be durable meaning if one of the Microservices is down then it can handle the event later. It also guarantees delivery.
2) Mediatr (Mediator pattern): Using CQRS the Mediatr pattern can be used to decouple commands and events making the MVC controller/service thinner.
I see how both of these patterns can be used in the same environment. I then see code like this:
3) In Memory Bus: https://github.com/gregoryyoung/m-r/blob/master/SimpleCQRS/FakeBus.cs. It is an In Memory bus.
What is the difference between using Mediatr and an In Memory Bus? The way I am thinking at the moment is that Mediatr is more appropriate when using the Observer pattern and an In Memory Bus is more suitable when using the publisher/subsciber pattern. Have I understood this correctly?
Is it appropriate to use an InMemory Bus for a single Microservice (for domain events) and a durable Message bus for integration events (between Microsservices)?