Interface IDispatchMessage
Marker interface for all messages that can be dispatched through the messaging pipeline.
public interface IDispatchMessage
- Extension Methods
Remarks
This is a marker interface used for type identification in the Excalibur framework. Message properties such as MessageId, MessageType and Headers are managed through the framework infrastructure:
- IMessageContext - Contains message properties during pipeline processing
- IMessageMetadata - Contains metadata for serialization and transport
- MessageEnvelope - Wraps message with metadata and context for persistence (Inbox/Outbox)
A message's kind is not carried by any of those. It is determined by which of the following interfaces the type implements, and that choice decides which middleware applies to it:
- IDispatchEvent - For domain and integration events
- IDispatchAction - For commands and queries
- IDispatchDocument - For document-style messages
Implement whichever matches your message's intent. Implementing only this marker leaves the type with no kind, and the middleware that applies to it cannot be determined from the type alone. Such a message is treated as All, so every middleware applies to it — the least-understood type receives the most protection, never the least. Dispatch is not refused and no exception is thrown.
Because that fallback is silent by design, it is reported on the current activity as an event named
dispatch.message.unclassified, tagged with the message type and the interfaces it may
declare. Without it the omission would surface downstream as an authorization failure, which names
the wrong problem: a missing interface, seen as a rejected message.