public interface QueryMessage<T,R> extends Message<T>
Handlers should only answer a query if they can respond with the appropriate response type.
Modifier and Type | Method and Description |
---|---|
QueryMessage<T,R> |
andMetaData(Map<String,?> additionalMetaData)
Returns a copy of this Message with it MetaData merged with the given
metaData . |
String |
getQueryName()
Returns the name identifying the query to be executed.
|
Class<R> |
getResponseType()
The type of response expected by the sender of the query
|
QueryMessage<T,R> |
withMetaData(Map<String,?> metaData)
Returns a copy of this Message with the given
metaData . |
getIdentifier, getMetaData, getPayload, getPayloadType
String getQueryName()
Class<R> getResponseType()
QueryMessage<T,R> withMetaData(Map<String,?> metaData)
Message
metaData
. The payload remains unchanged.
While the implementation returned may be different than the implementation of this
, implementations
must take special care in returning the same type of Message (e.g. EventMessage, DomainEventMessage) to prevent
errors further downstream.withMetaData
in interface Message<T>
metaData
- The new MetaData for the MessageQueryMessage<T,R> andMetaData(Map<String,?> additionalMetaData)
Message
metaData
. The payload
remains unchanged.andMetaData
in interface Message<T>
additionalMetaData
- The MetaData to merge withCopyright © 2010–2017. All rights reserved.