public static class SubscribingEventProcessor.Builder extends AbstractEventProcessor.Builder
SubscribingEventProcessor.
The RollbackConfigurationType defaults to a RollbackConfigurationType.ANY_THROWABLE, the
ErrorHandler is defaulted to a PropagatingErrorHandler, the MessageMonitor defaults to a
SpanFactory is defaulted to a NoOpSpanFactory, the
MessageMonitor defaults to a NoOpMessageMonitor, the EventProcessingStrategy defaults to
a DirectEventProcessingStrategy and the TransactionManager defaults to the
NoTransactionManager.INSTANCE. The Event Processor name, EventHandlerInvoker and
SubscribableMessageSource are hard requirements and as such should be provided.
name| Constructor and Description |
|---|
Builder() |
public SubscribingEventProcessor.Builder name(@Nonnull String name)
AbstractEventProcessor.Buildername of this EventProcessor implementation.name in class AbstractEventProcessor.Buildername - a String defining this EventProcessor implementationpublic SubscribingEventProcessor.Builder eventHandlerInvoker(@Nonnull EventHandlerInvoker eventHandlerInvoker)
AbstractEventProcessor.BuilderEventHandlerInvoker which will handle all the individual EventMessages.eventHandlerInvoker in class AbstractEventProcessor.BuildereventHandlerInvoker - the EventHandlerInvoker which will handle all the individual EventMessagespublic SubscribingEventProcessor.Builder rollbackConfiguration(@Nonnull RollbackConfiguration rollbackConfiguration)
RollbackConfiguration specifying the rollback behavior of the UnitOfWork while
processing a batch of events.. Defaults to a RollbackConfigurationType.ANY_THROWABLE)rollbackConfiguration in class AbstractEventProcessor.BuilderrollbackConfiguration - the RollbackConfiguration specifying the rollback behavior of the UnitOfWork while processing a batch of events.public SubscribingEventProcessor.Builder errorHandler(@Nonnull ErrorHandler errorHandler)
AbstractEventProcessor.BuilderErrorHandler invoked when an UnitOfWork is rolled back during processing. Defaults
to a PropagatingErrorHandler.errorHandler in class AbstractEventProcessor.BuildererrorHandler - the ErrorHandler invoked when an UnitOfWork is rolled back during
processingpublic SubscribingEventProcessor.Builder messageMonitor(@Nonnull MessageMonitor<? super EventMessage<?>> messageMonitor)
AbstractEventProcessor.BuilderMessageMonitor to monitor EventMessages before and after they're processed. Defaults
to a NoOpMessageMonitor.messageMonitor in class AbstractEventProcessor.BuildermessageMonitor - a MessageMonitor to monitor EventMessages before and after they're
processedpublic SubscribingEventProcessor.Builder spanFactory(@Nonnull SpanFactory spanFactory)
AbstractEventProcessor.BuilderSpanFactory implementation to use for providing tracing capabilities. Defaults to a
NoOpSpanFactory by default, which provides no tracing capabilities.spanFactory in class AbstractEventProcessor.BuilderspanFactory - The SpanFactory implementationpublic SubscribingEventProcessor.Builder messageSource(@Nonnull SubscribableMessageSource<? extends EventMessage<?>> messageSource)
SubscribableMessageSource (e.g. the EventBus) to which this EventProcessor
implementation will subscribe itself to receive EventMessages.messageSource - the SubscribableMessageSource (e.g. the EventBus) to which this EventProcessor implementation will subscribe itself to receive EventMessagespublic SubscribingEventProcessor.Builder processingStrategy(@Nonnull EventProcessingStrategy processingStrategy)
EventProcessingStrategy determining whether events are processed directly or asynchronously.
Defaults to a DirectEventProcessingStrategy.processingStrategy - the EventProcessingStrategy determining whether events are processed
directly or asynchronouslypublic SubscribingEventProcessor.Builder transactionManager(@Nonnull TransactionManager transactionManager)
TransactionManager used when processing EventMessages.transactionManager - the TransactionManager used when processing EventMessagespublic SubscribingEventProcessor build()
SubscribingEventProcessor as specified through this Builder.SubscribingEventProcessor as specified through this Builderprotected void validate()
throws AxonConfigurationException
validate in class AbstractEventProcessor.BuilderAxonConfigurationException - if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2023. All rights reserved.