Class AxonServerConfiguration.PersistentStreamSettings
- Enclosing class:
AxonServerConfiguration
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintThe maximum number of events to process in a single transaction when reading a persistent stream.@Nullable StringExpression to filter out events in a persistent stream, using Axon Server Query Language as its syntax.The initial token position for the persistent stream.intThe number of segments for the persistent stream if it needs to be created.@Nullable StringgetName()An optional override for the stream name on Axon Server.The sequencing policy to use for the persistent stream.Parameters specified for the sequencing policy.intThe number of threads used to process tasks (e.g. event handling) for the persistent stream.voidsetBatchSize(int batchSize) Sets the maximum number of events to process in a single transaction when reading a persistent stream.voidSets the expression to filter out events in a persistent stream, expecting the Axon Server Query Language as its syntax.voidsetInitialPosition(String initialPosition) Sets the initial token for the persistent stream.voidsetInitialSegmentCount(int initialSegmentCount) Sets the number of segments for the persistent stream if it needs to be created.voidSets an optional override for the stream name on Axon Server.voidsetSequencingPolicy(String sequencingPolicy) Sets the sequencing policy to use for the persistent stream.voidsetSequencingPolicyParameters(List<String> sequencingPolicyParameters) Sets the parameters specified for the sequencing policy.voidsetThreadCount(int threadCount) Sets the number of threads used to process tasks (e.g. event handling) for the persistent stream.
-
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
The sequencing policy to use for the persistent stream.- Returns:
- the sequencing policy name
-
setSequencingPolicy
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
Parameters specified for the sequencing policy.- Returns:
- a list of parameters specified for the sequencing policy
-
setSequencingPolicyParameters
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
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-0001exception.- Returns:
- the filter expression, or
nullif no filter is set
-
setFilter
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-0001exception.- Parameters:
filter- the filter expression, ornullto receive all events
-
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
nullto use the map key
-
setName
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
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
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
-