public class QuerySerializer extends Object
QueryMessage and QueryResponseMessage and Axon Server gRPC Query and QueryResponse messages.| Constructor and Description |
|---|
QuerySerializer(Serializer messageSerializer,
Serializer serializer,
AxonServerConfiguration configuration)
Instantiate a serializer used to convert Axon
QueryMessages and QueryResponseMessages into Axon
Server gRPC messages and vice versa. |
| Modifier and Type | Method and Description |
|---|---|
<Q,R> QueryMessage<Q,R> |
deserializeRequest(io.axoniq.axonserver.grpc.query.QueryRequest queryRequest)
Convert a
QueryRequest into a QueryMessage. |
QueryResponseMessage<?> |
deserializeResponse(io.axoniq.axonserver.grpc.query.QueryResponse queryResponse)
Converts a
QueryResponse into a QueryResponseMessage. |
<R> QueryResponseMessage<R> |
deserializeResponse(io.axoniq.axonserver.grpc.query.QueryResponse queryResponse,
ResponseType<R> expectedResponseType)
Convert a
QueryResponse into a QueryResponseMessage. |
<Q,R> io.axoniq.axonserver.grpc.query.QueryRequest |
serializeRequest(QueryMessage<Q,R> queryMessage,
int nrResults,
long timeout,
int priority)
Convert a
QueryMessage into a QueryRequest. |
<Q,R> io.axoniq.axonserver.grpc.query.QueryRequest |
serializeRequest(QueryMessage<Q,R> queryMessage,
int nrResults,
long timeout,
int priority,
boolean stream)
Convert a
QueryMessage into a QueryRequest. |
io.axoniq.axonserver.grpc.query.QueryResponse |
serializeResponse(QueryResponseMessage<?> queryResponse,
String requestMessageId)
Convert a
QueryResponseMessage into a QueryResponse. |
public QuerySerializer(Serializer messageSerializer, Serializer serializer, AxonServerConfiguration configuration)
QueryMessages and QueryResponseMessages into Axon
Server gRPC messages and vice versa. The provided messageSerializer is used for converting a message's
payload and metadata, whilst the serializer is used to convert a QueryMessage's ResponseType.messageSerializer - a Serializer used to de-/serialize an Axon Server gRPC message into QueryMessages and QueryResponseMessages and vice versaserializer - a Serializer used to create a dedicated converter for a QueryMessage
ResponseTypeconfiguration - an AxonServerConfiguration used to set the configurable component id and name in
the messagespublic <Q,R> io.axoniq.axonserver.grpc.query.QueryRequest serializeRequest(QueryMessage<Q,R> queryMessage, int nrResults, long timeout, int priority)
QueryMessage into a QueryRequest. The provided nrResults, timeout and
priority are all set on the QueryRequest to respectively define the number of results, after which time
the query should be aborted and the priority of the query amont others.Q - a generic specifying the payload type of the given queryMessageR - a generic specifying the response type of the given queryMessagequeryMessage - the QueryMessage to convert into a QueryRequestnrResults - an int denoting the number of expected resultstimeout - a long specifying the timeout in milliseconds of the created QueryRequestpriority - a int defining the priority among other QueryRequestsQueryRequest based on the provided queryMessagepublic <Q,R> io.axoniq.axonserver.grpc.query.QueryRequest serializeRequest(QueryMessage<Q,R> queryMessage, int nrResults, long timeout, int priority, boolean stream)
QueryMessage into a QueryRequest. The provided nrResults, timeout and
priority are all set on the QueryRequest to respectively define the number of results, after which time
the query should be aborted and the priority of the query amont others.Q - a generic specifying the payload type of the given queryMessageR - a generic specifying the response type of the given queryMessagequeryMessage - the QueryMessage to convert into a QueryRequestnrResults - an int denoting the number of expected resultstimeout - a long specifying the timeout in milliseconds of the created QueryRequestpriority - a int defining the priority among other QueryRequestsstream - indicates whether results of this query should be streamed or notQueryRequest based on the provided queryMessagepublic io.axoniq.axonserver.grpc.query.QueryResponse serializeResponse(QueryResponseMessage<?> queryResponse, String requestMessageId)
QueryResponseMessage into a QueryResponse.queryResponse - a QueryResponseMessage to convert into a QueryResponserequestMessageId - a String specifying the identity of the original request messageQueryResponse based on the provided queryResponsepublic <Q,R> QueryMessage<Q,R> deserializeRequest(io.axoniq.axonserver.grpc.query.QueryRequest queryRequest)
QueryRequest into a QueryMessage.Q - a generic specifying the payload type of the QueryMessage to convert toR - a generic specifying the response type of the QueryMessage to convert toqueryRequest - a QueryRequest to convert into a QueryMessageQueryMessage based on the provided queryRequestpublic <R> QueryResponseMessage<R> deserializeResponse(io.axoniq.axonserver.grpc.query.QueryResponse queryResponse, ResponseType<R> expectedResponseType)
QueryResponse into a QueryResponseMessage.R - a generic specifying the type of the QueryResponseMessage to convert toqueryResponse - a QueryResponse to convert into a QueryResponseMessageQueryResponseMessage based on the provided queryResponsepublic QueryResponseMessage<?> deserializeResponse(io.axoniq.axonserver.grpc.query.QueryResponse queryResponse)
QueryResponse into a QueryResponseMessage. It does not assume the type of the
payload.queryResponse - a QueryResponse to convert into a QueryResponseMessageQueryResponseMessage based on the provided queryResponseCopyright © 2010–2023. All rights reserved.