public class SubscribingEventProcessor extends AbstractEventProcessor
subscribes
to the EventBus
for
events. Events published on the event bus are supplied to this processor in the publishing thread.
Depending on the given EventProcessingStrategy
the events are processed directly (in the publishing thread)
or asynchronously.
Modifier and Type | Class and Description |
---|---|
static class |
SubscribingEventProcessor.Builder
Builder class to instantiate a
SubscribingEventProcessor . |
Modifier | Constructor and Description |
---|---|
protected |
SubscribingEventProcessor(SubscribingEventProcessor.Builder builder)
Instantiate a
SubscribingEventProcessor based on the fields contained in the SubscribingEventProcessor.Builder . |
Modifier and Type | Method and Description |
---|---|
static SubscribingEventProcessor.Builder |
builder()
Instantiate a Builder to be able to create a
SubscribingEventProcessor . |
protected void |
process(List<? extends EventMessage<?>> eventMessages)
Process the given messages.
|
void |
shutDown()
Shut down this processor.
|
void |
start()
Start this processor.
|
canHandle, eventHandlerInvoker, getHandlerInterceptors, getName, processInUnitOfWork, processInUnitOfWork, registerHandlerInterceptor, reportIgnored, toString
protected SubscribingEventProcessor(SubscribingEventProcessor.Builder builder)
SubscribingEventProcessor
based on the fields contained in the SubscribingEventProcessor.Builder
.
Will assert that the Event Processor name
, EventHandlerInvoker
and
SubscribableMessageSource
are not null
, and will throw an AxonConfigurationException
if
any of them is null
.
builder
- the SubscribingEventProcessor.Builder
used to instantiate a SubscribingEventProcessor
instancepublic static SubscribingEventProcessor.Builder builder()
SubscribingEventProcessor
.
The RollbackConfigurationType
defaults to a RollbackConfigurationType.ANY_THROWABLE
, the
ErrorHandler
is defaulted to a PropagatingErrorHandler
, the MessageMonitor
defaults to a
NoOpMessageMonitor
and the EventProcessingStrategy
defaults to a
DirectEventProcessingStrategy
. The Event Processor name
, EventHandlerInvoker
and
SubscribableMessageSource
are hard requirements and as such should be provided.
SubscribingEventProcessor
public void start()
EventBus
.protected void process(List<? extends EventMessage<?>> eventMessages)
This implementation creates a Batching unit of work for the given batch of eventMessages
.
eventMessages
- The messages to processpublic void shutDown()
EventBus
.Copyright © 2010–2019. All rights reserved.