Interface CommandMessage<T>
- Type Parameters:
T- The type of payload contained in the message
- All Superinterfaces:
Message<T>,Serializable
- All Known Implementing Classes:
GenericCommandMessage,GrpcBackedCommandMessage
Represents a Message carrying a command as its payload. These messages carry an intention to change application
state.
- Since:
- 2.0
- Author:
- Allard Buijze
-
Method Summary
Modifier and TypeMethodDescriptionandMetaData(Map<String, ?> metaData) Returns a copy of this CommandMessage with it MetaData merged with the givenmetaData.Returns the name of the command to execute.withMetaData(Map<String, ?> metaData) Returns a copy of this CommandMessage with the givenmetaData.Methods inherited from interface org.axonframework.messaging.Message
getIdentifier, getMetaData, getPayload, getPayloadType, serializeMetaData, serializePayload
-
Method Details
-
getCommandName
String getCommandName()Returns the name of the command to execute. This is an indication of what should be done, using the payload as parameter.- Returns:
- the name of the command
-
withMetaData
Returns a copy of this CommandMessage with the givenmetaData. The payload remains unchanged. While the implementation returned may be different than the implementation ofthis, implementations must take special care in returning the same type of Message (e.g. EventMessage, DomainEventMessage) to prevent errors further downstream.- Specified by:
withMetaDatain interfaceMessage<T>- Parameters:
metaData- The new MetaData for the Message- Returns:
- a copy of this message with the given MetaData
-
andMetaData
Returns a copy of this CommandMessage with it MetaData merged with the givenmetaData. The payload remains unchanged.- Specified by:
andMetaDatain interfaceMessage<T>- Parameters:
metaData- The MetaData to merge with- Returns:
- a copy of this message with the given MetaData
-