Class EventProcessorControlService

java.lang.Object
org.axonframework.axonserver.connector.processor.EventProcessorControlService
All Implemented Interfaces:
org.axonframework.lifecycle.Lifecycle

public class EventProcessorControlService extends Object implements org.axonframework.lifecycle.Lifecycle
Service that listens to PlatformOutboundInstructions to control EventProcessors when for example requested by Axon Server. Will delegate the calls to the AxonServerConnectionManager for further processing.
Since:
4.0
Author:
Sara Pellegrini
  • Field Details

  • Constructor Details

    • EventProcessorControlService

      public EventProcessorControlService(AxonServerConnectionManager axonServerConnectionManager, org.axonframework.config.EventProcessingConfiguration eventProcessingConfiguration, AxonServerConfiguration axonServerConfiguration)
      Initialize a EventProcessorControlService.

      This service adds processor instruction handlers to the ControlChannel of the default context. Doing so ensures operation like the start and shutdown can be triggered through Axon Server. Furthermore, it sets the configured load balancing strategies} through the AdminChannel of the default context.

      Parameters:
      axonServerConnectionManager - A AxonServerConnectionManager from which to retrieve the ControlChannel and AdminChannel.
      eventProcessingConfiguration - The EventProcessor configuration of this application, used to retrieve the registered event processors from.
      axonServerConfiguration - The AxonServerConfiguration used to retrieve the default context from.
    • EventProcessorControlService

      @Deprecated public EventProcessorControlService(AxonServerConnectionManager axonServerConnectionManager, org.axonframework.config.EventProcessingConfiguration eventProcessingConfiguration, String context)
      Deprecated.
      Initialize a EventProcessorControlService.

      This service adds processor instruction handlers to the ControlChannel of the given context. Doing so ensures operation like the start and shutdown can be triggered through Axon Server. Furthermore, it sets the configured load balancing strategies} through the AdminChannel of the context.

      Parameters:
      axonServerConnectionManager - A AxonServerConnectionManager from which to retrieve the ControlChannel and AdminChannel.
      eventProcessingConfiguration - The EventProcessor configuration of this application, used to retrieve the registered event processors from.
      context - The context of this application instance to retrieve the ControlChannel and AdminChannel for.
    • EventProcessorControlService

      public EventProcessorControlService(AxonServerConnectionManager axonServerConnectionManager, org.axonframework.config.EventProcessingConfiguration eventProcessingConfiguration, String context, Map<String,AxonServerConfiguration.Eventhandling.ProcessorSettings> processorConfig)
      Initialize a EventProcessorControlService.

      This service adds processor instruction handlers to the ControlChannel of the given context. Doing so ensures operation like the start and shutdown can be triggered through Axon Server. Furthermore, it sets the configured load balancing strategies through the AdminChannel of the context.

      Parameters:
      axonServerConnectionManager - A AxonServerConnectionManager from which to retrieve the ControlChannel and AdminChannel.
      eventProcessingConfiguration - The EventProcessor configuration of this application, used to retrieve the registered event processors from.
      context - The context of this application instance to retrieve the ControlChannel and AdminChannel for.
      processorConfig - The processor configuration from the AxonServerConfiguration, used to (for example) retrieve the load balancing strategies from.
  • Method Details

    • registerLifecycleHandlers

      public void registerLifecycleHandlers(@Nonnull org.axonframework.lifecycle.Lifecycle.LifecycleRegistry lifecycle)
      Specified by:
      registerLifecycleHandlers in interface org.axonframework.lifecycle.Lifecycle
    • start

      public void start()
      Registers EventProcessor instruction handlers to the ControlChannel for the configured context and set the load balancing strategies through the AdminChannel for the configured context.

      The registration is performed in Phase.INBOUND_EVENT_CONNECTORS phase, to ensure the event processors this service provides control over have been started.

    • infoSupplier

      protected Supplier<io.axoniq.axonserver.grpc.control.EventProcessorInfo> infoSupplier(org.axonframework.eventhandling.EventProcessor processor)
      Constructs an EventProcessorInfo for the given processor. Typically results in a StreamingEventProcessor or SubscribingEventProcessor specific instance.
      Parameters:
      processor - The EventProcessor to construct a EventProcessorInfo for.
      Returns:
      A Supplier of EventProcessorInfo, based on the given processor.