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.
  • Constructor Details

    • ProcessorSettings

      public ProcessorSettings()
  • Method Details

    • source

      public String source()
      Returns the name of the bean that should be used as source for Event Messages. If not provided, the EventBus is used as source.
      Specified by:
      source in interface EventProcessorSettings
      Returns:
      the name of the bean that should be used as source for Event Messages.
    • setSource

      public void setSource(String source)
      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 to EventProcessorProperties.Mode.POOLED.
      Returns:
      the type of processor to configure.
    • processorMode

      public EventProcessorSettings.ProcessorMode processorMode()
      Retrieves the processor mode.
      Specified by:
      processorMode in interface EventProcessorSettings
      Specified by:
      processorMode in interface EventProcessorSettings.PooledEventProcessorSettings
      Specified by:
      processorMode in interface EventProcessorSettings.SubscribingEventProcessorSettings
      Returns:
      pooled-streaming or subscribed mode, falls back to pooled-streaming.
    • setMode

      public void setMode(EventProcessorProperties.Mode mode)
      Sets the type of processor that should be configured. Defaults to EventProcessorProperties.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 a PooledStreamingEventProcessor.
      Specified by:
      initialSegmentCount in interface EventProcessorSettings.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 a PooledStreamingEventProcessor.
      Parameters:
      initialSegmentCount - the number of initial segments that should be created.
    • getTokenClaimInterval

      public long getTokenClaimInterval()
      Returns the interval between attempts to claim tokens by a StreamingEventProcessor. 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 a StreamingEventProcessor.
    • getTokenClaimIntervalTimeUnit

      public TimeUnit getTokenClaimIntervalTimeUnit()
      Returns the time unit used to define tokens claim interval. Defaults to TimeUnit.MILLISECONDS.
      Returns:
      the time unit used to defined tokens claim interval.
    • tokenClaimIntervalInMillis

      public long tokenClaimIntervalInMillis()
      Description copied from interface: EventProcessorSettings.PooledEventProcessorSettings
      Retrieves token claim interval.
      Specified by:
      tokenClaimIntervalInMillis in interface EventProcessorSettings.PooledEventProcessorSettings
      Returns:
      interval in milliseconds.
    • setTokenClaimIntervalTimeUnit

      public void setTokenClaimIntervalTimeUnit(TimeUnit tokenClaimIntervalTimeUnit)
      Sets the time unit used to defined tokens claim interval. It must be a valid value of TimeUnit. Defaults to TimeUnit.MILLISECONDS.
      Parameters:
      tokenClaimIntervalTimeUnit - the time unit used to defined tokens claim interval.
    • claimExtensionThresholdInMillis

      public long claimExtensionThresholdInMillis()
      Description copied from interface: EventProcessorSettings.PooledEventProcessorSettings
      Threshold, in milliseconds, after which a work package extends the claim on its TrackingToken in the absence of event handling.

      Defaults to 5000 milliseconds, matching the default of the pooled streaming processor configuration.

      Specified by:
      claimExtensionThresholdInMillis in interface EventProcessorSettings.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 a PooledStreamingEventProcessor extends 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.PooledEventProcessorSettings
      Whether 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 to false.

      Specified by:
      coordinatorClaimExtension in interface EventProcessorSettings.PooledEventProcessorSettings
      Returns:
      true if the coordinator extends the claims of its work packages, false otherwise
    • setCoordinatorClaimExtension

      public void setCoordinatorClaimExtension(boolean coordinatorClaimExtension)
      Sets whether the coordinator of a PooledStreamingEventProcessor extends the claims of its work packages. Defaults to false.
      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 a StreamingEventProcessor implementation. Defaults to the configured number of initial segments. If this field is not configured, the thread count defaults to 4 for a PooledStreamingEventProcessor.
      Specified by:
      threadCount in interface EventProcessorSettings.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 a PooledStreamingEventProcessor.

      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:
      batchSize in interface EventProcessorSettings.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

      public void setTokenStore(String tokenStore)
      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 to null, is what leaves the name unset
    • tokenStore

      public @Nullable String tokenStore()
      Retrieves the name of the TokenStore bean.
      Specified by:
      tokenStore in interface EventProcessorSettings.PooledEventProcessorSettings
      Returns:
      name of the token store Spring Bean, or null when unset
    • sequencingPolicy

      public String sequencingPolicy()
      Returns the name of the bean that defines the SequencingPolicy for this processor.
      Returns:
      the name of the bean that defines the SequencingPolicy for this processor.
    • setSequencingPolicy

      public void setSequencingPolicy(String sequencingPolicy)
      Sets the name of the bean that defines the SequencingPolicy for this processor. The SequencingPolicy describes which Events must be handled sequentially, and which can be handled concurrently. Defaults to a SequentialPerAggregatePolicy.
      Parameters:
      sequencingPolicy - the name of the bean that defines the SequencingPolicy for this processor.