-
Notifications
You must be signed in to change notification settings - Fork 2
core.messaging.design
As part of the CQRS pattern, queries are separated from commands. The core messaging plugin supports sending commands and publishing domain events. In-process delivery of messages is supported by default. Other technology specific plugins, such as RabbitMQ, can extend the pipeline by implementing custom publishers. Below is an illustration of the key components contained within the implementation.
Interface identifying a message that is handled by a consumer. There are two types of messages:
- ICommand: Represents a message that updates the state managed by a Microservice.
- IDomainEvent: Represents a message that notifies other subscribing components that a change was made to the the domain managed by the Microservice.
Central service used to dispatch queries, send commands, and publish domain events. For dispatching messages, the service delegates to the MessageDispatcher instance.
Marker interface identifying components that can handle messages.
Plugin module responsible for locating all IMessageConsumer concrete classes and registering them as services with a scoped lifetime. The consumer message handlers are identified as any defined method passed a IMessage parameter and marked with the InProcessHandler attribute.
Interface implemented by a classes responsible for adding key/value pairs to a passed message. Implementations can set common property values on all messages consistently from a central location. For example, the below are two default enrichers:
- DatePublishedEnricher: Adds a key/value with the date the message was published.
- CorrelationEnricher: Adds a GUID key/value used to identify the message.
Plugin module, when initialized, registers all configured IMessageEnricher concrete types within the service collection as scoped services.
Interface implemented to extend the messaging pipeline to determine how messages are dispatched. The core messaging plugin and various other technology specific plugins provided IMessagePublisher implementations:
- InProcessMessagePublisher: The default implementation that is automatically registered and dispatches messages to consumers located in the same process as the publisher.
- RabbitMqPublisher: Registered when the NetFusion.RabbitMq plugin is added to the composite application. Allows specified messages to be delivered, out of process, to a message broker and processed by queue subscribers.
- RedisPublisher: Allows specified messages to be delivered, out of process, to a Redis channel and processed by subscribers when the NetFusion.Redis plugin is added to the composite application.
Plugin module responsible for dispatching a message by invoking all registered IMessageEnricher and IMessagePublisher instances.
-
Templates
-
Resources
-
Bootstrapping
-
Modules Details
-
Settings
-
Validation
-
Monitoring
- Setup
- Commands
- Queries
- Domain Events
- Message Logs
- Message Publishers
- Message Enrichers
- Message Filters
-
Azure Service Bus
-
RabbitMQ
-
Redis
-
MongoDB