Interface ReactorMessageDispatchInterceptor<M extends Message>
- Type Parameters:
M- the type ofMessagethis interceptor handles
public interface ReactorMessageDispatchInterceptor<M extends Message>
Reactor equivalent of
MessageDispatchInterceptor.
Runs inside the Reactor subscription, giving access to Reactor's context (e.g.,
ReactiveSecurityContextHolder) which is not available in Axon Framework's native
MessageDispatchInterceptor.
Implementations intercept a message before dispatch, potentially enriching it (e.g., adding metadata), and must call
chain.proceed(message, context) to continue the chain.
- Since:
- 4.4.2
- Author:
- Milan Savic, Theo Emanuelsson
-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<?> interceptOnDispatch(M message, @Nullable ProcessingContext context, ReactorMessageDispatchInterceptorChain<M> chain) Intercepts a message before dispatch.
-
Method Details
-
interceptOnDispatch
reactor.core.publisher.Mono<?> interceptOnDispatch(M message, @Nullable ProcessingContext context, ReactorMessageDispatchInterceptorChain<M> chain) Intercepts a message before dispatch. Implementations may enrich the message (e.g., add metadata) and must callchain.proceed(message, context)to continue the chain.- Parameters:
message- the message being dispatchedcontext- the active processing context, if anychain- the remaining interceptor chain- Returns:
- a
Monothat completes with the (possibly enriched) message
-