public class CommandSerializer extends Object
CommandMessages and Axon Server gRPC Command messages.| Constructor and Description |
|---|
CommandSerializer(Serializer serializer,
AxonServerConfiguration configuration)
Instantiate a serializer used to convert Axon
CommandMessages and CommandResultMessages into Axon
Server gRPC messages and vice versa. |
| Modifier and Type | Method and Description |
|---|---|
CommandMessage<?> |
deserialize(io.axoniq.axonserver.grpc.command.Command command)
Convert a
Command into a CommandMessage. |
<R> CommandResultMessage<R> |
deserialize(io.axoniq.axonserver.grpc.command.CommandResponse commandResponse)
Convert a
CommandResponse into a CommandResultMessage. |
io.axoniq.axonserver.grpc.command.Command |
serialize(CommandMessage<?> commandMessage,
String routingKey,
int priority)
Convert a
CommandMessage into a Command. |
io.axoniq.axonserver.grpc.command.CommandResponse |
serialize(CommandResultMessage<?> commandResultMessage,
String requestIdentifier)
Convert a
CommandResultMessage into a CommandProviderOutbound. |
public CommandSerializer(Serializer serializer, AxonServerConfiguration configuration)
CommandMessages and CommandResultMessages into Axon
Server gRPC messages and vice versa. The provided serializer is used for both from and to
framework-server conversions.serializer - a Serializer used to de-/serialize an Axon Server gRPC message into a CommandMessage or CommandResultMessage and vice versaconfiguration - an AxonServerConfiguration used to set the configurable component id and name in the
messagespublic io.axoniq.axonserver.grpc.command.Command serialize(CommandMessage<?> commandMessage, String routingKey, int priority)
CommandMessage into a Command. The routingKey and priority respectively
define which service to route the command to and what the command's priority among others is.commandMessage - the CommandMessage to convert into a CommandroutingKey - a String defining the routing key of the given CommandMessagepriority - a int defining the priority of the given CommandMessageCommand based on the provided commandMessagepublic io.axoniq.axonserver.grpc.command.CommandResponse serialize(CommandResultMessage<?> commandResultMessage, String requestIdentifier)
CommandResultMessage into a CommandProviderOutbound.commandResultMessage - the CommandResultMessage to convert into a CommandProviderOutboundrequestIdentifier - a String identifying where the original request came fromCommandProviderOutbound based on the provided commandResultMessagepublic CommandMessage<?> deserialize(io.axoniq.axonserver.grpc.command.Command command)
Command into a CommandMessage.command - the Command to convert into a CommandMessageCommandMessage based on the provided commandpublic <R> CommandResultMessage<R> deserialize(io.axoniq.axonserver.grpc.command.CommandResponse commandResponse)
CommandResponse into a CommandResultMessage.R - a generic specifying the response payload typecommandResponse - the CommandResponse to convert into a CommandResultMessageCommandResultMessage of generic R based on the provided commandResponseCopyright © 2010–2023. All rights reserved.