Interface MessageMonitorRegistry
- All Superinterfaces:
DescribableComponent
- All Known Implementing Classes:
DefaultMessageMonitorRegistry
MessageMonitors, acting as a collection of
registered MessageMonitor components.
Provides operations to register generic Message, CommandMessage-specific,
EventMessage-specific, or QueryMessage-specific MessageMonitors. Multiple
MessageMonitors will be combined to a single MultiMessageMonitor.
Ingesting and reporting of messages is done via monitoring interception which wrap the monitor. These interception
are registered through the MessagingConfigurationDefaults dispatcher registry factory methods.
These operations are expected to be invoked within a
DecoratorDefinition. As such, any registered monitors are
only applied when the infrastructure component requiring them is constructed. When, for example, an
InterceptingCommandBus is constructed, this registry
is invoked to retrieve monitors. Interceptors that are registered once the InterceptingCommandBus has already
been constructed are not taken into account.
- Since:
- 5.0.0
- Author:
- Jan Galinski
-
Method Summary
Modifier and TypeMethodDescriptionMessageMonitor<? super CommandMessage> commandMonitor(Configuration config, Class<?> componentType, @Nullable String componentName) Retrieves aMessageMonitordedicated for monitoringCommandMessageprocessing for a specificcomponentTypeandcomponentName.MessageMonitor<? super EventMessage> eventMonitor(Configuration config, Class<?> componentType, @Nullable String componentName) Retrieves aMessageMonitorspecifically designed to monitor the processing ofEventMessageinstances for a specificcomponentTypeandcomponentName.MessageMonitor<? super QueryMessage> queryMonitor(Configuration config, Class<?> componentType, @Nullable String componentName) Retrieves aMessageMonitorfor monitoring the processing ofQueryMessageinstances for a specificcomponentTypeandcomponentName.registerCommandMonitor(ComponentBuilder<MessageMonitor<? super CommandMessage>> monitorBuilder) Registers aMessageMonitorspecifically for monitoring the processing ofCommandMessageinstances.registerCommandMonitor(MessageMonitorFactory<? super CommandMessage> monitorFactory) Registers a component-awareMessageMonitorspecifically for monitoring the processing ofCommandMessageinstances using the givenmonitorFactory.registerEventMonitor(ComponentBuilder<MessageMonitor<? super EventMessage>> monitorBuilder) Registers aMessageMonitorspecific forEventMessagetypes using the supplied monitor builder.registerEventMonitor(MessageMonitorFactory<? super EventMessage> monitorFactory) Registers a component-awareMessageMonitorspecifically for monitoring the processing ofEventMessageinstances using the givenmonitorFactory.registerMonitor(ComponentBuilder<MessageMonitor<Message>> monitorBuilder) Registers aMessageMonitorfor genericMessagetypes using the supplied monitor builder.registerMonitor(MessageMonitorFactory<Message> monitorFactory) Registers a component-awareMessageMonitorfor genericMessagetypes using the givenmonitorFactory.registerQueryMonitor(ComponentBuilder<MessageMonitor<? super QueryMessage>> monitorBuilder) registerQueryMonitor(MessageMonitorFactory<? super QueryMessage> monitorFactory) Registers a component-awareMessageMonitorspecifically for monitoring the processing ofQueryMessageinstances using the givenmonitorFactory.registerSubscriptionQueryUpdateMonitor(ComponentBuilder<MessageMonitor<? super SubscriptionQueryUpdateMessage>> monitorBuilder) Registers aMessageMonitorspecifically forSubscriptionQueryUpdateMessagetypes using the providedComponentBuilder.registerSubscriptionQueryUpdateMonitor(MessageMonitorFactory<? super SubscriptionQueryUpdateMessage> monitorFactory) Registers a component-awareMessageMonitorspecifically for monitoring the processing ofSubscriptionQueryUpdateMessageinstances using the givenmonitorFactory.subscriptionQueryUpdateMonitor(Configuration config, Class<?> componentType, @Nullable String componentName) Retrieves aMessageMonitorfor monitoring the processing ofSubscriptionQueryUpdateMessageinstances for a specificcomponentTypeandcomponentName.Methods inherited from interface org.axonframework.common.infra.DescribableComponent
describeTo
-
Method Details
-
registerMonitor
Registers aMessageMonitorfor genericMessagetypes using the supplied monitor builder.Registering a monitor per a
ComponentBuilderensures the monitor is only built once.- Parameters:
monitorBuilder- theComponentBuilderresponsible for creating theMessageMonitorinstance for genericMessagetypes- Returns:
- the updated
MessageMonitorRegistryinstance for fluent configuration
-
registerMonitor
Registers a component-awareMessageMonitorfor genericMessagetypes using the givenmonitorFactory.The factory will receive the component type and name when the monitor is retrieved allowing for omponent-specific customization of the monitor. Registering a monitor per a
MessageMonitorFactoryenforces construction of the monitor for every invocation of the factory, ensuring uniqueness per given type and name. If the monitor will be identical regardless of the given type or name, please useregisterMonitor(ComponentBuilder)instead.- Parameters:
monitorFactory- theMessageMonitorFactoryresponsible for creating theMessageMonitorinstance for genericMessagetypes- Returns:
- the updated
MessageMonitorRegistryinstance for fluent configuration
-
registerCommandMonitor
MessageMonitorRegistry registerCommandMonitor(ComponentBuilder<MessageMonitor<? super CommandMessage>> monitorBuilder) Registers aMessageMonitorspecifically for monitoring the processing ofCommandMessageinstances.Registering a monitor per a
ComponentBuilderensures the monitor is only build once.- Parameters:
monitorBuilder- theComponentBuilderused to create theMessageMonitorinstance forCommandMessagetypes- Returns:
- the updated
MessageMonitorRegistryinstance, allowing for a fluent configuration approach
-
registerCommandMonitor
MessageMonitorRegistry registerCommandMonitor(MessageMonitorFactory<? super CommandMessage> monitorFactory) Registers a component-awareMessageMonitorspecifically for monitoring the processing ofCommandMessageinstances using the givenmonitorFactory.The factory will receive the component type and name when the monitor is retrieved allowing for component-specific customization of the monitor. Registering a monitor per a
MessageMonitorFactoryenforces construction of the monitor for every invocation of the factory, ensuring uniqueness per given type and name. If the monitor will be identical regardless of the given type or name, please useregisterCommandMonitor(ComponentBuilder)instead.- Parameters:
monitorFactory- theMessageMonitorFactoryused to create theMessageMonitorinstance forCommandMessagetypes- Returns:
- the updated
MessageMonitorRegistryinstance, allowing for a fluent configuration approach
-
registerEventMonitor
MessageMonitorRegistry registerEventMonitor(ComponentBuilder<MessageMonitor<? super EventMessage>> monitorBuilder) Registers aMessageMonitorspecific forEventMessagetypes using the supplied monitor builder.Registering a monitor per a
ComponentBuilderensures the monitor is only build once.- Parameters:
monitorBuilder- theComponentBuilderresponsible for creating theMessageMonitorinstance forEventMessagetypes- Returns:
- the updated
MessageMonitorRegistryinstance, allowing for a fluent configuration approach
-
registerEventMonitor
MessageMonitorRegistry registerEventMonitor(MessageMonitorFactory<? super EventMessage> monitorFactory) Registers a component-awareMessageMonitorspecifically for monitoring the processing ofEventMessageinstances using the givenmonitorFactory.The factory will receive the component type and name when the monitor is retrieved allowing for component-specific customization of the monitor. Registering a monitor per a
MessageMonitorFactoryenforces construction of the monitor for every invocation of the factory, ensuring uniqueness per given type and name. If the monitor will be identical regardless of the given type or name, please useregisterEventMonitor(ComponentBuilder)instead.- Parameters:
monitorFactory- theMessageMonitorFactoryresponsible for creating theMessageMonitorinstance forEventMessagetypes- Returns:
- the updated
MessageMonitorRegistryinstance, allowing for a fluent configuration approach
-
registerQueryMonitor
MessageMonitorRegistry registerQueryMonitor(ComponentBuilder<MessageMonitor<? super QueryMessage>> monitorBuilder) Registers aMessageMonitorspecifically forQueryMessagetypes using the providedComponentBuilder.Registering a monitor per a
ComponentBuilderensures the monitor is only build once.- Parameters:
monitorBuilder- theComponentBuilderresponsible for creating theMessageMonitorforQueryMessagetypes- Returns:
- the updated
MessageMonitorRegistryinstance, allowing for a fluent configuration approach
-
registerQueryMonitor
MessageMonitorRegistry registerQueryMonitor(MessageMonitorFactory<? super QueryMessage> monitorFactory) Registers a component-awareMessageMonitorspecifically for monitoring the processing ofQueryMessageinstances using the givenmonitorFactory.The factory will receive the component type and name when the monitor is retrieved allowing for component-specific customization of the monitor. Registering a monitor per a
MessageMonitorFactoryenforces construction of the monitor for every invocation of the factory, ensuring uniqueness per given type and name. If the monitor will be identical regardless of the given type or name, please useregisterQueryMonitor(ComponentBuilder)instead.- Parameters:
monitorFactory- theMessageMonitorFactoryresponsible for creating theMessageMonitorforQueryMessagetypes- Returns:
- the updated
MessageMonitorRegistryinstance, allowing for a fluent configuration approach
-
registerSubscriptionQueryUpdateMonitor
MessageMonitorRegistry registerSubscriptionQueryUpdateMonitor(ComponentBuilder<MessageMonitor<? super SubscriptionQueryUpdateMessage>> monitorBuilder) Registers aMessageMonitorspecifically forSubscriptionQueryUpdateMessagetypes using the providedComponentBuilder.Registering a monitor per a
ComponentBuilderensures the monitor is only build once.- Parameters:
monitorBuilder- theComponentBuilderresponsible for creating theMessageMonitorforSubscriptionQueryUpdateMessagetypes- Returns:
- the updated
MessageMonitorRegistryinstance, allowing for a fluent configuration approach
-
registerSubscriptionQueryUpdateMonitor
MessageMonitorRegistry registerSubscriptionQueryUpdateMonitor(MessageMonitorFactory<? super SubscriptionQueryUpdateMessage> monitorFactory) Registers a component-awareMessageMonitorspecifically for monitoring the processing ofSubscriptionQueryUpdateMessageinstances using the givenmonitorFactory.The factory will receive the component type and name when the monitor is retrieved allowing for component-specific customization of the monitor. Registering a monitor per a
MessageMonitorFactoryenforces construction of the monitor for every invocation of the factory, ensuring uniqueness per given type and name. If the monitor will be identical regardless of the given type or name, please useregisterSubscriptionQueryUpdateMonitor(ComponentBuilder)instead.- Parameters:
monitorFactory- theMessageMonitorFactoryresponsible for creating theMessageMonitorforSubscriptionQueryUpdateMessagetypes- Returns:
- the updated
MessageMonitorRegistryinstance, allowing for a fluent configuration approach
-
commandMonitor
MessageMonitor<? super CommandMessage> commandMonitor(Configuration config, Class<?> componentType, @Nullable String componentName) Retrieves aMessageMonitordedicated for monitoringCommandMessageprocessing for a specificcomponentTypeandcomponentName.The returned monitor contains generic
MessageMessageMonitorsthat have beenregisteredwhen the generic builder/factory returns an instance.- Parameters:
config- theConfigurationinstance used to create theMessageMonitorinstancescomponentType- the type of the component to retrieve a monitor forcomponentName- the name of the component to retrieve a monitor for- Returns:
MultiMessageMonitorcomposed of all registeredMessageMonitors, orNoOpMessageMonitor
-
eventMonitor
MessageMonitor<? super EventMessage> eventMonitor(Configuration config, Class<?> componentType, @Nullable String componentName) Retrieves aMessageMonitorspecifically designed to monitor the processing ofEventMessageinstances for a specificcomponentTypeandcomponentName.The returned monitor contains generic
MessageMessageMonitorsthat have beenregisteredwhen the generic builder/factory returns an instance.- Parameters:
config- theConfigurationinstance used to create or retrieve theMessageMonitorinstancescomponentType- the type of the component to retrieve a monitor forcomponentName- the name of the component to retrieve a monitor for- Returns:
MultiMessageMonitorcomposed of all registeredMessageMonitors, orNoOpMessageMonitor
-
queryMonitor
MessageMonitor<? super QueryMessage> queryMonitor(Configuration config, Class<?> componentType, @Nullable String componentName) Retrieves aMessageMonitorfor monitoring the processing ofQueryMessageinstances for a specificcomponentTypeandcomponentName.The returned monitor contains generic
MessageMessageMonitorsthat have beenregisteredwhen the generic builder/factory returns an instance.- Parameters:
config- theConfigurationused to create or retrieve theMessageMonitorforQueryMessagetypescomponentType- the type of the component to retrieve a monitor forcomponentName- the name of the component to retrieve a monitor for- Returns:
MultiMessageMonitorcomposed of all registeredMessageMonitors, orNoOpMessageMonitor
-
subscriptionQueryUpdateMonitor
MessageMonitor<? super SubscriptionQueryUpdateMessage> subscriptionQueryUpdateMonitor(Configuration config, Class<?> componentType, @Nullable String componentName) Retrieves aMessageMonitorfor monitoring the processing ofSubscriptionQueryUpdateMessageinstances for a specificcomponentTypeandcomponentName.The returned monitor contains generic
MessageMessageMonitorsthat have beenregisteredwhen the generic builder/factory returns an instance.- Parameters:
config- theConfigurationused to create or retrieve theMessageMonitorforSubscriptionQueryUpdateMessagetypescomponentType- the type of the component to retrieve a monitor forcomponentName- the name of the component to retrieve a monitor for- Returns:
MultiMessageMonitorcomposed of all registeredMessageMonitors, orNoOpMessageMonitor
-