Interface EventProcessor

All Superinterfaces:
MessageHandlerInterceptorSupport<EventMessage<?>>
All Known Subinterfaces:
StreamingEventProcessor
All Known Implementing Classes:
AbstractEventProcessor, PooledStreamingEventProcessor, SubscribingEventProcessor, TrackingEventProcessor

public interface EventProcessor extends MessageHandlerInterceptorSupport<EventMessage<?>>
An Event Processor processes event messages from an event queue or event bus.

Typically, an Event Processor is in charge of publishing the events to a group of registered handlers. This allows attributes and behavior (e.g. transaction management, asynchronous processing, distribution) to be applied over a whole group at once.

Since:
1.2
Author:
Allard Buijze
  • Method Details

    • getName

      String getName()
      Returns the name of this event processor. This name is used to detect distributed instances of the same event processor. Multiple instances referring to the same logical event processor (on different JVM's) must have the same name.
      Returns:
      the name of this event processor
    • getHandlerInterceptors

      List<MessageHandlerInterceptor<? super EventMessage<?>>> getHandlerInterceptors()
      Return the list of already registered MessageHandlerInterceptors for this event processor. To register a new interceptor use MessageHandlerInterceptorSupport.registerHandlerInterceptor(MessageHandlerInterceptor)
      Returns:
      the list of registered interceptors of this event processor
    • start

      void start()
      Start processing events.
    • shutDown

      void shutDown()
      Stops processing events. Blocks until the shutdown is complete.
    • isRunning

      boolean isRunning()
      Indicates whether this processor is currently running (i.e. consuming events from its message source).
      Returns:
      true when running, otherwise false
    • isError

      boolean isError()
      Indicates whether the processor has been shut down due to an error. In such case, the processor has forcefully shut down, as it wasn't able to automatically recover.

      Note that this method returns false when the processor was stopped using shutDown().

      Returns:
      true when paused due to an error, otherwise false
    • shutdownAsync

      default CompletableFuture<Void> shutdownAsync()
      Initiates a shutdown, providing a CompletableFuture that completes when the shutdown process is finished.
      Returns:
      a CompletableFuture that completes when the shutdown process is finished.