Class ReactiveRequestHandlerAdvice
java.lang.Object
org.springframework.integration.handler.advice.ReactiveRequestHandlerAdvice
- All Implemented Interfaces:
org.aopalliance.aop.Advice
,org.aopalliance.intercept.Interceptor
,org.aopalliance.intercept.MethodInterceptor
public class ReactiveRequestHandlerAdvice
extends java.lang.Object
implements org.aopalliance.intercept.MethodInterceptor
A
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.- Since:
- 5.3
-
Constructor Summary
Constructors Constructor Description ReactiveRequestHandlerAdvice(java.util.function.BiFunction<org.springframework.messaging.Message<?>,reactor.core.publisher.Mono<?>,org.reactivestreams.Publisher<?>> replyCustomizer)
Instantiate advice based on a providedBiFunction
customizer. -
Method Summary
Modifier and Type Method Description java.lang.Object
invoke(org.aopalliance.intercept.MethodInvocation invocation)
-
Constructor Details
-
ReactiveRequestHandlerAdvice
public ReactiveRequestHandlerAdvice(java.util.function.BiFunction<org.springframework.messaging.Message<?>,reactor.core.publisher.Mono<?>,org.reactivestreams.Publisher<?>> replyCustomizer)Instantiate advice based on a providedBiFunction
customizer.- Parameters:
replyCustomizer
- theBiFunction
to customize producedMono
.
-
-
Method Details
-
invoke
public final java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation invocation) throws java.lang.Throwable- Specified by:
invoke
in interfaceorg.aopalliance.intercept.MethodInterceptor
- Throws:
java.lang.Throwable
-