Package org.axonframework.messaging.core
Interface MessageDispatchInterceptor<M extends Message>
- Type Parameters:
M- The message type this interceptor can process.
- All Known Implementing Classes:
BeanValidationInterceptor,CorrelationDataInterceptor,LoggingInterceptor,MessageAuthorizationDispatchInterceptor,MonitoringEventDispatchInterceptor,MonitoringSubscriptionQueryUpdateDispatchInterceptor
public interface MessageDispatchInterceptor<M extends Message>
Interceptor that allows
messages to be intercepted and modified before they are dispatched.
This interceptor provides a very early means to alter or reject message, even before any ProcessingContext is
created.
- Since:
- 2.0.0
- Author:
- Allard Buijze, Simon Zambrovski
-
Method Summary
Modifier and TypeMethodDescriptioninterceptOnDispatch(M message, ProcessingContext context, MessageDispatchInterceptorChain<M> interceptorChain) Intercepts a givenmessageon dispatching.
-
Method Details
-
interceptOnDispatch
@Nonnull MessageStream<?> interceptOnDispatch(@Nonnull M message, @Nullable ProcessingContext context, @Nonnull MessageDispatchInterceptorChain<M> interceptorChain) Intercepts 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)).- 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).
-