Class EventProcessorControlService
- All Implemented Interfaces:
org.axonframework.lifecycle.Lifecycle
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classNested classes/interfaces inherited from interface org.axonframework.lifecycle.Lifecycle
org.axonframework.lifecycle.Lifecycle.LifecycleHandler, org.axonframework.lifecycle.Lifecycle.LifecycleRegistry -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AxonServerConnectionManagerprotected final Stringprotected final org.axonframework.config.EventProcessingConfigurationprotected final Map<String,AxonServerConfiguration.Eventhandling.ProcessorSettings> -
Constructor Summary
ConstructorsConstructorDescriptionEventProcessorControlService(AxonServerConnectionManager axonServerConnectionManager, org.axonframework.config.EventProcessingConfiguration eventProcessingConfiguration, String context) Deprecated.EventProcessorControlService(AxonServerConnectionManager axonServerConnectionManager, org.axonframework.config.EventProcessingConfiguration eventProcessingConfiguration, String context, Map<String, AxonServerConfiguration.Eventhandling.ProcessorSettings> processorConfig) Initialize aEventProcessorControlService.EventProcessorControlService(AxonServerConnectionManager axonServerConnectionManager, org.axonframework.config.EventProcessingConfiguration eventProcessingConfiguration, AxonServerConfiguration axonServerConfiguration) Initialize aEventProcessorControlService. -
Method Summary
Modifier and TypeMethodDescriptionprotected Supplier<io.axoniq.axonserver.grpc.control.EventProcessorInfo>infoSupplier(org.axonframework.eventhandling.EventProcessor processor) Constructs anEventProcessorInfofor the givenprocessor.voidregisterLifecycleHandlers(org.axonframework.lifecycle.Lifecycle.LifecycleRegistry lifecycle) voidstart()RegistersEventProcessorinstruction handlers to theControlChannelfor the configuredcontextand set the load balancing strategies through theAdminChannelfor the configuredcontext.
-
Field Details
-
axonServerConnectionManager
-
eventProcessingConfiguration
protected final org.axonframework.config.EventProcessingConfiguration eventProcessingConfiguration -
context
-
processorConfig
-
-
Constructor Details
-
EventProcessorControlService
public EventProcessorControlService(AxonServerConnectionManager axonServerConnectionManager, org.axonframework.config.EventProcessingConfiguration eventProcessingConfiguration, AxonServerConfiguration axonServerConfiguration) Initialize aEventProcessorControlService.This service adds processor instruction handlers to the
ControlChannelof thedefault context. Doing so ensures operation like thestartandshutdowncan be triggered through Axon Server. Furthermore, it sets the configured load balancing strategies} through theAdminChannelof the default context.- Parameters:
axonServerConnectionManager- AAxonServerConnectionManagerfrom which to retrieve theControlChannelandAdminChannel.eventProcessingConfiguration- TheEventProcessorconfiguration of this application, used to retrieve the registered event processors from.axonServerConfiguration- TheAxonServerConfigurationused to retrieve thedefault contextfrom.
-
EventProcessorControlService
@Deprecated public EventProcessorControlService(AxonServerConnectionManager axonServerConnectionManager, org.axonframework.config.EventProcessingConfiguration eventProcessingConfiguration, String context) Deprecated.Please useEventProcessorControlService(AxonServerConnectionManager, EventProcessingConfiguration, String, Map)to ensure processor settings are provided.Initialize aEventProcessorControlService.This service adds processor instruction handlers to the
ControlChannelof the givencontext. Doing so ensures operation like thestartandshutdowncan be triggered through Axon Server. Furthermore, it sets the configured load balancing strategies} through theAdminChannelof thecontext.- Parameters:
axonServerConnectionManager- AAxonServerConnectionManagerfrom which to retrieve theControlChannelandAdminChannel.eventProcessingConfiguration- TheEventProcessorconfiguration of this application, used to retrieve the registered event processors from.context- The context of this application instance to retrieve theControlChannelandAdminChannelfor.
-
EventProcessorControlService
public EventProcessorControlService(AxonServerConnectionManager axonServerConnectionManager, org.axonframework.config.EventProcessingConfiguration eventProcessingConfiguration, String context, Map<String, AxonServerConfiguration.Eventhandling.ProcessorSettings> processorConfig) Initialize aEventProcessorControlService.This service adds processor instruction handlers to the
ControlChannelof the givencontext. Doing so ensures operation like thestartandshutdowncan be triggered through Axon Server. Furthermore, it sets the configured load balancing strategies through theAdminChannelof thecontext.- Parameters:
axonServerConnectionManager- AAxonServerConnectionManagerfrom which to retrieve theControlChannelandAdminChannel.eventProcessingConfiguration- TheEventProcessorconfiguration of this application, used to retrieve the registered event processors from.context- The context of this application instance to retrieve theControlChannelandAdminChannelfor.processorConfig- The processor configuration from theAxonServerConfiguration, 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:
registerLifecycleHandlersin interfaceorg.axonframework.lifecycle.Lifecycle
-
start
public void start()RegistersEventProcessorinstruction handlers to theControlChannelfor the configuredcontextand set the load balancing strategies through theAdminChannelfor the configuredcontext.The registration is performed in
Phase.INBOUND_EVENT_CONNECTORSphase, 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 anEventProcessorInfofor the givenprocessor. Typically results in aStreamingEventProcessororSubscribingEventProcessorspecific instance.- Parameters:
processor- TheEventProcessorto construct aEventProcessorInfofor.- Returns:
- A
SupplierofEventProcessorInfo, based on the givenprocessor.
-
EventProcessorControlService(AxonServerConnectionManager, EventProcessingConfiguration, String, Map)to ensure processor settings are provided.