public class ReactiveRequestHandlerAdvice extends Object implements MethodInterceptor
MethodInterceptor for message handlers producing a Mono as a payload for reply.
The returned Mono is customized via Mono.transform(java.util.function.Function) operator
calling provided replyCustomizer BiFunction with request message as a context.
A customization assumes to use supporting reactive operators like Mono.timeout(java.time.Duration),
Mono.retry(), Mono.tag(java.lang.String, java.lang.String) etc.
A Mono.transform(java.util.function.Function) also can be used
for further customization like reactive circuit breaker.| Constructor and Description |
|---|
ReactiveRequestHandlerAdvice(java.util.function.BiFunction<Message<?>,reactor.core.publisher.Mono<?>,org.reactivestreams.Publisher<?>> replyCustomizer)
Instantiate advice based on a provided
BiFunction customizer. |
public ReactiveRequestHandlerAdvice(java.util.function.BiFunction<Message<?>,reactor.core.publisher.Mono<?>,org.reactivestreams.Publisher<?>> replyCustomizer)
BiFunction customizer.replyCustomizer - the BiFunction to customize produced Mono.public final Object invoke(MethodInvocation invocation) throws Throwable
invoke in interface MethodInterceptorThrowable