Class SerializerProperties

java.lang.Object
org.axonframework.springboot.SerializerProperties

@ConfigurationProperties("axon.serializer") public class SerializerProperties extends Object
A group of properties that allows easy configuration of the serializers used for different types of objects that Axon needs to serialize.

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).

  • 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

      public void setGeneral(SerializerProperties.SerializerType serializerType)
      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

      public void setEvents(SerializerProperties.SerializerType serializerType)
      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

      public void setMessages(SerializerProperties.SerializerType serializerType)
      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.