Class EventProcessorControlService
- All Implemented Interfaces:
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
Lifecycle.LifecycleHandler, Lifecycle.LifecycleRegistry -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AxonServerConnectionManagerprotected final Stringprotected final EventProcessingConfigurationprotected final Map<String, AxonServerConfiguration.Eventhandling.ProcessorSettings> -
Constructor Summary
ConstructorsConstructorDescriptionEventProcessorControlService(AxonServerConnectionManager axonServerConnectionManager, EventProcessingConfiguration eventProcessingConfiguration, String context) Deprecated.EventProcessorControlService(AxonServerConnectionManager axonServerConnectionManager, EventProcessingConfiguration eventProcessingConfiguration, String context, Map<String, AxonServerConfiguration.Eventhandling.ProcessorSettings> processorConfig) Initialize aEventProcessorControlService.EventProcessorControlService(AxonServerConnectionManager axonServerConnectionManager, EventProcessingConfiguration eventProcessingConfiguration, AxonServerConfiguration axonServerConfiguration) Initialize aEventProcessorControlService. -
Method Summary
Modifier and TypeMethodDescriptionprotected Supplier<io.axoniq.axonserver.grpc.control.EventProcessorInfo> infoSupplier(EventProcessor processor) Constructs anEventProcessorInfofor the givenprocessor.voidRegisters the activities to be executed in the various phases of an application's lifecycle.voidstart()RegistersEventProcessorinstruction handlers to theControlChannelfor the configuredcontextand set the load balancing strategies through theAdminChannelfor the configuredcontext.
-
Field Details
-
axonServerConnectionManager
-
eventProcessingConfiguration
-
context
-
processorConfig
-
-
Constructor Details
-
EventProcessorControlService
public EventProcessorControlService(AxonServerConnectionManager axonServerConnectionManager, 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, 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, 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
Description copied from interface:LifecycleRegisters the activities to be executed in the various phases of an application's lifecycle. This could either be at startup, shutdown, or both.- Specified by:
registerLifecycleHandlersin interfaceLifecycle- Parameters:
lifecycle- the lifecycle instance to register the handlers with- See Also:
-
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(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.