57
CHAPTER 3 | Architecting container and microservice-based applications
and Query Responsibility Segregation (CQRS)
architecture pattern. The goal is to have eventual
consistency between multiple data sources across your distributed system.
Figure 4-19. Asynchronous event-driven message communication
In asynchronous event-driven communication, one microservice publishes events to an event bus and
many microservices can subscribe to it, to get notified and act on it. Your implementation will
determine what protocol to use for event-driven, message-based communications.
AMQP
can help
achieve reliable queued communication.
When you use an event bus, you might want to use an abstraction level (like an event bus interface)
based on a related implementation in classes with code using the API from a message broker like
RabbitMQ
or a service bus like
Azure Service Bus with Topics
. Alternatively, you might want to use a
higher-level service bus like
NServiceBus
,
MassTransit
, or
Brighter
to articulate your event bus and
publish/subscribe system.
Dostları ilə paylaş: