137
CHAPTER 5 | Designing and Developing Multi-Container and Microservice-Based .NET Applications
In Figure 6-19 you can see how, from an application point of view, the event
bus is nothing more than
a Pub/Sub channel. The way you implement this asynchronous communication can vary. It can have
multiple implementations so that you can swap between them, depending on the environment
requirements (for example, production versus development environments).
In Figure 6-20, you can see an abstraction of an event bus with multiple implementations
based on
infrastructure messaging technologies like RabbitMQ, Azure Service Bus, or another event/message
broker.
Figure 6- 20. Multiple implementations of an event bus
It’s good to have the event bus defined through an interface so it can
be implemented with several
technologies, like RabbitMQ, Azure Service bus or others. However, and as mentioned previously,
using your own abstractions (the event bus interface) is good only
if you need basic event bus
features supported by your abstractions. If you need richer service bus features, you should probably
use the API and abstractions provided by your preferred commercial service bus instead of your own
abstractions.
Dostları ilə paylaş: