title | summary | component | reviewed | related | redirects | |||
---|---|---|---|---|---|---|---|---|
Interfaces as messages |
Define interfaces as messages in NServiceBus to support multiple inheritance scenarios |
core |
2024-04-04 |
|
|
Events can be created on the fly from interfaces without first defining an explicit class implementing the interfaces. This technique can be used to support multiple inheritance for polymorphic routing scenarios. In general, it is recommended to use dedicated, simple types as messages instead.
Interface messages can be sent using the following syntax:
snippet: InterfaceSend
Replies are supported via:
snippet: InterfaceReply
Interface messages can be published using the following syntax:
snippet: InterfacePublish
If an interface message is needed before calling Send
or Publish
, use IMessageCreator
directly to create the message instance:
snippet: IMessageCreatorUsage