Class SerializerProperties
The Event serializer, if specified, is used to serialize the payload and meta-data of EventMessages as they are stored in the event store and published. If no Event Serializer is specified, it defaults to the Message Serializer.
The Message Serializer is used to serialize the payload and meta-data of all messages and, where relevant, their return values. Commands, Queries and Events, but also the Command Result and Query Responses are serialized using this serializer. If no Message Serializer is specified, it defaults to the General Serializer.
The General Serializer is used to serialize the rest of the objects, such as TrackingTokens, Saga state,
Snapshot Events and all other data that needs to be serialized, but is not expected to be shared with other systems.
If no General Serializer is specified, it defaults to an XStream based serializer (see
XStreamSerializer).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumerates different possible standard serializers, available in Axon. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe type of serializer to use to serialize the payload and meta data of Event Messages.The type of serializer to use to serialize any type of object, for which no more specific serializer is configured.The type of serializer to use to serialize the payload and meta data of Messages.voidsetEvents(SerializerProperties.SerializerType serializerType) The type of serializer to use to serialize the payload and meta data of Event Messages.voidsetGeneral(SerializerProperties.SerializerType serializerType) Sets the type of serializer to use to serialize any type of object, for which no more specific serializer is configured.voidsetMessages(SerializerProperties.SerializerType serializerType) The type of serializer to use to serialize the payload and meta data of Messages.
-
Constructor Details
-
SerializerProperties
public SerializerProperties()
-
-
Method Details
-
getGeneral
The type of serializer to use to serialize any type of object, for which no more specific serializer is configured. Defaults to an XStream based serializer.- Returns:
- The serializer to use for serialization of all kinds of objects
-
setGeneral
Sets the type of serializer to use to serialize any type of object, for which no more specific serializer is configured. Defaults to an XStream based serializer.- Parameters:
serializerType- The serializer to use for serialization of all kinds of objects.
-
getEvents
The type of serializer to use to serialize the payload and meta data of Event Messages. Defaults to the Message Serializer, or otherwise the General Serializer.- Returns:
- The type of serializer to use for Event Messages.
-
setEvents
The type of serializer to use to serialize the payload and meta data of Event Messages. Defaults to the Message Serializer, or otherwise the General Serializer.- Parameters:
serializerType- The type of serializer to use for Event Messages.
-
getMessages
The type of serializer to use to serialize the payload and meta data of Messages. Defaults to the General Serializer.- Returns:
- The type of serializer to use for Messages.
-
setMessages
The type of serializer to use to serialize the payload and meta data of Messages. Defaults to the Message Serializer, or otherwise the General Serializer.- Parameters:
serializerType- The type of serializer to use for Messages.
-