Class EventProcessorProperties.ProcessorSettings
java.lang.Object
org.axonframework.extension.springboot.EventProcessorProperties.ProcessorSettings
- All Implemented Interfaces:
EventProcessorSettings,EventProcessorSettings.PooledEventProcessorSettings,EventProcessorSettings.SubscribingEventProcessorSettings
- Enclosing class:
EventProcessorProperties
public static class EventProcessorProperties.ProcessorSettings
extends Object
implements EventProcessorSettings.PooledEventProcessorSettings, EventProcessorSettings.SubscribingEventProcessorSettings
Processor settings.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.axonframework.extension.spring.config.EventProcessorSettings
EventProcessorSettings.MapWrapper, EventProcessorSettings.PooledEventProcessorSettings, EventProcessorSettings.ProcessorMode, EventProcessorSettings.SubscribingEventProcessorSettings -
Field Summary
Fields inherited from interface org.axonframework.extension.spring.config.EventProcessorSettings
DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the maximum size of a processing batch.longThreshold, in milliseconds, after which a work package extends the claim on itsTrackingTokenin the absence of event handling.booleanWhether the coordinator extends the claims of its work packages, rather than leaving that to the work packages themselves.getMode()Returns the type of processor to configure.longReturns the interval between attempts to claim tokens by aStreamingEventProcessor.Returns the time unit used to define tokens claim interval.intReturns the number of initial segments that should be created, if no segments are already present.Retrieves the processor mode.Returns the name of the bean that defines theSequencingPolicyfor this processor.voidsetBatchSize(int batchSize) Sets the maximum size of a processing batch.voidsetClaimExtensionThreshold(long claimExtensionThreshold) Sets the threshold, in milliseconds, after which a work package of aPooledStreamingEventProcessorextends the claim on its token.voidsetCoordinatorClaimExtension(boolean coordinatorClaimExtension) Sets whether the coordinator of aPooledStreamingEventProcessorextends the claims of its work packages.voidsetInitialSegmentCount(int initialSegmentCount) Sets the number of initial segments that should be created, if no segments are already present.voidSets the type of processor that should be configured.voidsetSequencingPolicy(String sequencingPolicy) Sets the name of the bean that defines theSequencingPolicyfor this processor.voidSets the name of the bean that should be used as source for Event Messages.voidsetThreadCount(int threadCount) Sets the number of threads to use to process Events.voidsetTokenClaimInterval(long tokenClaimInterval) Sets the time to wait after a failed attempt to claim any token, before making another attempt.voidsetTokenClaimIntervalTimeUnit(TimeUnit tokenClaimIntervalTimeUnit) Sets the time unit used to defined tokens claim interval.voidsetTokenStore(String tokenStore) Sets the name of the TokenStore bean.source()Returns the name of the bean that should be used as source for Event Messages.intReturns the number of threads to use to process Events, when using aStreamingEventProcessorimplementation.longRetrieves token claim interval.@Nullable StringRetrieves the name of the TokenStore bean.
-
Constructor Details
-
ProcessorSettings
public ProcessorSettings()
-
-
Method Details
-
source
Returns the name of the bean that should be used as source for Event Messages. If not provided, theEventBusis used as source.- Specified by:
sourcein interfaceEventProcessorSettings- Returns:
- the name of the bean that should be used as source for Event Messages.
-
setSource
Sets the name of the bean that should be used as source for Event Messages.- Parameters:
source- the name of the bean that should be used as source for Event Messages.
-
getMode
Returns the type of processor to configure. Defaults toEventProcessorProperties.Mode.POOLED.- Returns:
- the type of processor to configure.
-
processorMode
Retrieves the processor mode.- Specified by:
processorModein interfaceEventProcessorSettings- Specified by:
processorModein interfaceEventProcessorSettings.PooledEventProcessorSettings- Specified by:
processorModein interfaceEventProcessorSettings.SubscribingEventProcessorSettings- Returns:
- pooled-streaming or subscribed mode, falls back to pooled-streaming.
-
setMode
Sets the type of processor that should be configured. Defaults toEventProcessorProperties.Mode.POOLED.- Parameters:
mode- the type of processor that should be configured.
-
initialSegmentCount
public int initialSegmentCount()Returns the number of initial segments that should be created, if no segments are already present. Defaults to 16 for aPooledStreamingEventProcessor.- Specified by:
initialSegmentCountin interfaceEventProcessorSettings.PooledEventProcessorSettings- Returns:
- the number of initial segments that should be created.
-
setInitialSegmentCount
public void setInitialSegmentCount(int initialSegmentCount) Sets the number of initial segments that should be created, if no segments are already present. Defaults to 16 for aPooledStreamingEventProcessor.- Parameters:
initialSegmentCount- the number of initial segments that should be created.
-
getTokenClaimInterval
public long getTokenClaimInterval()Returns the interval between attempts to claim tokens by aStreamingEventProcessor. Defaults to 5000 milliseconds.- Returns:
- the interval between attempts to claim tokens by a
StreamingEventProcessor.
-
setTokenClaimInterval
public void setTokenClaimInterval(long tokenClaimInterval) Sets the time to wait after a failed attempt to claim any token, before making another attempt. Defaults to 5000 milliseconds.- Parameters:
tokenClaimInterval- the interval between attempts to claim tokens by aStreamingEventProcessor.
-
getTokenClaimIntervalTimeUnit
Returns the time unit used to define tokens claim interval. Defaults toTimeUnit.MILLISECONDS.- Returns:
- the time unit used to defined tokens claim interval.
-
tokenClaimIntervalInMillis
public long tokenClaimIntervalInMillis()Description copied from interface:EventProcessorSettings.PooledEventProcessorSettingsRetrieves token claim interval.- Specified by:
tokenClaimIntervalInMillisin interfaceEventProcessorSettings.PooledEventProcessorSettings- Returns:
- interval in milliseconds.
-
setTokenClaimIntervalTimeUnit
Sets the time unit used to defined tokens claim interval. It must be a valid value ofTimeUnit. Defaults toTimeUnit.MILLISECONDS.- Parameters:
tokenClaimIntervalTimeUnit- the time unit used to defined tokens claim interval.
-
claimExtensionThresholdInMillis
public long claimExtensionThresholdInMillis()Description copied from interface:EventProcessorSettings.PooledEventProcessorSettingsThreshold, in milliseconds, after which a work package extends the claim on itsTrackingTokenin the absence of event handling.Defaults to 5000 milliseconds, matching the default of the pooled streaming processor configuration.
- Specified by:
claimExtensionThresholdInMillisin interfaceEventProcessorSettings.PooledEventProcessorSettings- Returns:
- the claim extension threshold in milliseconds
-
setClaimExtensionThreshold
public void setClaimExtensionThreshold(long claimExtensionThreshold) Sets the threshold, in milliseconds, after which a work package of aPooledStreamingEventProcessorextends the claim on its token. Defaults to 5000 milliseconds.- Parameters:
claimExtensionThreshold- the claim extension threshold in milliseconds
-
coordinatorClaimExtension
public boolean coordinatorClaimExtension()Description copied from interface:EventProcessorSettings.PooledEventProcessorSettingsWhether the coordinator extends the claims of its work packages, rather than leaving that to the work packages themselves.Enable this when event handling regularly takes longer than the claim timeout of the
TokenStore: a work package cannot extend its own claim while it is handling a batch, nor while it waits for a thread of the worker executor that lengthy handling on other segments occupies. Defaults tofalse.- Specified by:
coordinatorClaimExtensionin interfaceEventProcessorSettings.PooledEventProcessorSettings- Returns:
trueif the coordinator extends the claims of its work packages,falseotherwise
-
setCoordinatorClaimExtension
public void setCoordinatorClaimExtension(boolean coordinatorClaimExtension) Sets whether the coordinator of aPooledStreamingEventProcessorextends the claims of its work packages. Defaults tofalse.- Parameters:
coordinatorClaimExtension- whether the coordinator extends the claims of its work packages
-
threadCount
public int threadCount()Returns the number of threads to use to process Events, when using aStreamingEventProcessorimplementation. Defaults to the configured number of initial segments. If this field is not configured, the thread count defaults to 4 for aPooledStreamingEventProcessor.- Specified by:
threadCountin interfaceEventProcessorSettings.PooledEventProcessorSettings- Returns:
- the number of threads to use to process Events.
-
setThreadCount
public void setThreadCount(int threadCount) Sets the number of threads to use to process Events. If this field is not configured, the thread count defaults to 4 for aPooledStreamingEventProcessor.- Parameters:
threadCount- the number of threads to use to process Events.
-
batchSize
public int batchSize()Returns the maximum size of a processing batch. This is the number of events that a processor in "tracking" and "pooled" mode will attempt to read and process within a single Unit of Work / Transaction.- Specified by:
batchSizein interfaceEventProcessorSettings.PooledEventProcessorSettings- Returns:
- the maximum size of a processing batch.
-
setBatchSize
public void setBatchSize(int batchSize) Sets the maximum size of a processing batch. This is the number of events that a processor in "tracking" and "pooled" mode will attempt to read and process within a single Unit of Work / Transaction. Defaults to 1.- Parameters:
batchSize- the maximum size of a processing batch.
-
setTokenStore
Sets the name of the TokenStore bean.- Parameters:
tokenStore- the name of the Spring Bean used for this processor; omitting the property, rather than binding it tonull, is what leaves the name unset
-
tokenStore
Retrieves the name of the TokenStore bean.- Specified by:
tokenStorein interfaceEventProcessorSettings.PooledEventProcessorSettings- Returns:
- name of the token store Spring Bean, or
nullwhen unset
-
sequencingPolicy
Returns the name of the bean that defines theSequencingPolicyfor this processor.- Returns:
- the name of the bean that defines the
SequencingPolicyfor this processor.
-
setSequencingPolicy
Sets the name of the bean that defines theSequencingPolicyfor this processor. TheSequencingPolicydescribes which Events must be handled sequentially, and which can be handled concurrently. Defaults to aSequentialPerAggregatePolicy.- Parameters:
sequencingPolicy- the name of the bean that defines theSequencingPolicyfor this processor.
-