Class AxonServerConfiguration.PersistentStreamSettings

java.lang.Object
io.axoniq.framework.axonserver.connector.api.AxonServerConfiguration.PersistentStreamSettings
Enclosing class:
AxonServerConfiguration

public static class AxonServerConfiguration.PersistentStreamSettings extends Object
Configuration properties for a named persistent stream event source.

Each entry under axon.axonserver.persistent-streams maps a logical source name to its stream settings. The source name becomes the Spring bean name and can be referenced in axon.eventhandling.processors.<processor-name>.source to wire a subscribing processor to the stream.

Since:
5.2.0
Author:
Jakob Hatzl
  • Constructor Details

    • PersistentStreamSettings

      public PersistentStreamSettings()
  • Method Details

    • getInitialSegmentCount

      public int getInitialSegmentCount()
      The number of segments for the persistent stream if it needs to be created.
      Returns:
      the number of segments for the persistent stream if it needs to be created
    • setInitialSegmentCount

      public void setInitialSegmentCount(int initialSegmentCount)
      Sets the number of segments for the persistent stream if it needs to be created.
      Parameters:
      initialSegmentCount - the number of segments
    • getThreadCount

      public int getThreadCount()
      The number of threads used to process tasks (e.g. event handling) for the persistent stream. Defaults to 1.
      Returns:
      the number of threads used to process tasks (e.g. event handling) for the persistent stream
    • setThreadCount

      public void setThreadCount(int threadCount)
      Sets the number of threads used to process tasks (e.g. event handling) for the persistent stream.
      Parameters:
      threadCount - the number of threads used to process tasks (e.g. event handling) for the persistent stream
    • getSequencingPolicy

      public String getSequencingPolicy()
      The sequencing policy to use for the persistent stream.
      Returns:
      the sequencing policy name
    • setSequencingPolicy

      public void setSequencingPolicy(String sequencingPolicy)
      Sets the sequencing policy to use for the persistent stream.

      Supported sequencing policies are:

      • SequentialPolicy
      • SequentialPerAggregatePolicy (default)
      • FullConcurrencyPolicy
      • PropertySequencingPolicy
      • MetadataSequencingPolicy

      This value is only used for creating the persistent stream.

      Parameters:
      sequencingPolicy - the sequencing policy name
    • getSequencingPolicyParameters

      public List<String> getSequencingPolicyParameters()
      Parameters specified for the sequencing policy.
      Returns:
      a list of parameters specified for the sequencing policy
    • setSequencingPolicyParameters

      public void setSequencingPolicyParameters(List<String> sequencingPolicyParameters)
      Sets the parameters specified for the sequencing policy.

      The PropertySequencingPolicy and MetadataSequencingPolicy require parameters.

      This value is only used for creating the persistent stream.

      Parameters:
      sequencingPolicyParameters - a list of parameters specified for the sequencing policy
    • getFilter

      public @Nullable String getFilter()
      Expression to filter out events in a persistent stream, using Axon Server Query Language as its syntax.

      Note that it is not possible to change the filter once the persistent stream has been created! When doing so, Axon Server will typically throw an AXONIQ-0001 exception.

      Returns:
      the filter expression, or null if no filter is set
    • setFilter

      public void setFilter(String filter)
      Sets the expression to filter out events in a persistent stream, expecting the Axon Server Query Language as its syntax.

      Note that it is not possible to change the filter once the persistent stream has been created! When doing so, Axon Server will typically throw an AXONIQ-0001 exception.

      Parameters:
      filter - the filter expression, or null to receive all events
    • getName

      public @Nullable String getName()
      An optional override for the stream name on Axon Server. When not set, the map key (the logical source name) is used as the stream name.
      Returns:
      the override stream name, or null to use the map key
    • setName

      public void setName(String name)
      Sets an optional override for the stream name on Axon Server. When not set, the map key (the logical source name) is used as the stream name.
      Parameters:
      name - the override stream name
    • getBatchSize

      public int getBatchSize()
      The maximum number of events to process in a single transaction when reading a persistent stream.
      Returns:
      the batch size
    • setBatchSize

      public void setBatchSize(int batchSize)
      Sets the maximum number of events to process in a single transaction when reading a persistent stream. The default value is 1.
      Parameters:
      batchSize - the batch size
    • getInitialPosition

      public String getInitialPosition()
      The initial token position for the persistent stream. This can be a global sequence in the event store or the keywords "HEAD" or "TAIL" for a respective position at the head or tail of the stream.
      Returns:
      the initial token position
    • setInitialPosition

      public void setInitialPosition(String initialPosition)
      Sets the initial token for the persistent stream. The default value is "TAIL", starting the persistent stream from the tail of the event store.

      You can use values "HEAD" or "TAIL" to start from the head or tail of the event stream.

      This value is only used for creating the persistent stream.

      Parameters:
      initialPosition - the initial token position