Class GrpcBackedQueryMessage<Q,R>
java.lang.Object
org.axonframework.axonserver.connector.query.GrpcBackedQueryMessage<Q,R>
- Type Parameters:
Q- a generic specifying the type of theQueryMessage's payloadR- a generic specifying the expected response type of theQueryMessage
- All Implemented Interfaces:
Serializable,Message<Q>,QueryMessage<Q,R>
Wrapper that allows clients to access a gRPC
QueryRequest as a QueryMessage.- Since:
- 4.0
- Author:
- Marc Gathier
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGrpcBackedQueryMessage(io.axoniq.axonserver.grpc.query.QueryRequest queryRequest, Serializer messageSerializer, Serializer serializer) Instantiate aGrpcBackedResponseMessagewith the givenqueryRequest, using the providedmessageSerializerto be able to retrieve the payload andMetaDatafrom it. -
Method Summary
Modifier and TypeMethodDescriptionandMetaData(Map<String, ?> metaData) Returns a copy of this QueryMessage with its MetaData merged with givenmetaData.Returns the identifier of this message.Returns the meta data for this message.Returns the payload of this message.Returns the type of the payload.Returns the name identifying the query to be executed.The type of response expected by the sender of the querywithMetaData(Map<String, ?> metaData) Returns a copy of this QueryMessage with the givenmetaData.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.messaging.Message
serializeMetaData, serializePayload
-
Constructor Details
-
GrpcBackedQueryMessage
public GrpcBackedQueryMessage(io.axoniq.axonserver.grpc.query.QueryRequest queryRequest, Serializer messageSerializer, Serializer serializer) Instantiate aGrpcBackedResponseMessagewith the givenqueryRequest, using the providedmessageSerializerto be able to retrieve the payload andMetaDatafrom it. Theserializeris solely used to deserialize the response type.- Parameters:
queryRequest- theQueryRequestwhich is being wrapped as aQueryMessagemessageSerializer- theSerializerused to deserialize the payload andMetaDatafrom the givenqueryRequestserializer- theSerializerused to deserialize the response type
-
-
Method Details
-
getQueryName
Description copied from interface:QueryMessageReturns the name identifying the query to be executed.- Specified by:
getQueryNamein interfaceQueryMessage<Q,R> - Returns:
- the name identifying the query to be executed.
-
getResponseType
Description copied from interface:QueryMessageThe type of response expected by the sender of the query- Specified by:
getResponseTypein interfaceQueryMessage<Q,R> - Returns:
- the type of response expected by the sender of the query
-
getIdentifier
Description copied from interface:MessageReturns the identifier of this message. Two messages with the same identifiers should be interpreted as different representations of the same conceptual message. In such case, the meta-data may be different for both representations. The payload may be identical.- Specified by:
getIdentifierin interfaceMessage<Q>- Returns:
- the unique identifier of this message
-
getMetaData
Description copied from interface:MessageReturns the meta data for this message. This meta data is a collection of key-value pairs, where the key is a String, and the value is a serializable object.- Specified by:
getMetaDatain interfaceMessage<Q>- Returns:
- the meta data for this message
-
getPayload
Description copied from interface:MessageReturns the payload of this message. The payload is the application-specific information.- Specified by:
getPayloadin interfaceMessage<Q>- Returns:
- the payload of this message
-
getPayloadType
Description copied from interface:MessageReturns the type of the payload. Is semantically equal togetPayload().getClass(), but allows implementations to optimize by using lazy loading or deserialization.- Specified by:
getPayloadTypein interfaceMessage<Q>- Returns:
- the type of payload.
-
withMetaData
Description copied from interface:QueryMessageReturns a copy of this QueryMessage with the givenmetaData. The payload remains unchanged.- Specified by:
withMetaDatain interfaceMessage<Q>- Specified by:
withMetaDatain interfaceQueryMessage<Q,R> - Parameters:
metaData- The new MetaData for the QueryMessage- Returns:
- a copy of this message with the given MetaData
-
andMetaData
Description copied from interface:QueryMessageReturns a copy of this QueryMessage with its MetaData merged with givenmetaData. The payload remains unchanged.- Specified by:
andMetaDatain interfaceMessage<Q>- Specified by:
andMetaDatain interfaceQueryMessage<Q,R> - Parameters:
metaData- The MetaData to merge into the QueryMessage- Returns:
- a copy of this message with the given additional MetaData
-