Class MonitoringEventDispatchInterceptor
java.lang.Object
org.axonframework.messaging.monitoring.interception.MonitoringEventDispatchInterceptor
- All Implemented Interfaces:
MessageDispatchInterceptor<EventMessage>
public class MonitoringEventDispatchInterceptor
extends Object
implements MessageDispatchInterceptor<EventMessage>
A
MessageDispatchInterceptor that intercepts a MessageDispatchInterceptorChain of
EventMessage and registers the MessageMonitor.MonitorCallback hooks for reporting. Invoked by the
InterceptingEventSink.- Since:
- 5.0.0
- Author:
- Jan Galinski
-
Constructor Summary
ConstructorsConstructorDescriptionMonitoringEventDispatchInterceptor(MessageMonitor<? super EventMessage> messageMonitor) Constructs a new MonitoringEventDispatchInterceptor using the givenMessageMonitor. -
Method Summary
Modifier and TypeMethodDescriptioninterceptOnDispatch(EventMessage message, ProcessingContext context, MessageDispatchInterceptorChain<EventMessage> interceptorChain) Intercepts a givenmessageon dispatching.
-
Constructor Details
-
MonitoringEventDispatchInterceptor
public MonitoringEventDispatchInterceptor(@Nonnull MessageMonitor<? super EventMessage> messageMonitor) Constructs a new MonitoringEventDispatchInterceptor using the givenMessageMonitor.- Parameters:
messageMonitor- TheMessageMonitorinstance used for reporting.
-
-
Method Details
-
interceptOnDispatch
@Nonnull public MessageStream<?> interceptOnDispatch(@Nonnull EventMessage message, @Nullable ProcessingContext context, @Nonnull MessageDispatchInterceptorChain<EventMessage> interceptorChain) Description copied from interface:MessageDispatchInterceptorIntercepts a givenmessageon dispatching. The implementer of this method might want to intercept the message before passing it to the chain (effectively before callingMessageDispatchInterceptorChain.proceed(Message, ProcessingContext)) or after the chain (by mapping the resulting message by callingMessageStream.mapMessage(Function)).- Specified by:
interceptOnDispatchin interfaceMessageDispatchInterceptor<EventMessage>- Parameters:
message- The message to intercept on dispatching.context- The active processing context, if any. Can be used to (e.g.) validate correlation data.interceptorChain- The interceptor chain to signal that processing is finished and further interceptors should be called.- Returns:
- The resulting message stream from
MessageDispatchInterceptorChain.proceed(Message, ProcessingContext).
-