Interface ReceiveMessageAdvice
- All Superinterfaces:
Advice
,Interceptor
,MethodInterceptor
- All Known Subinterfaces:
MessageSourceMutator
- All Known Implementing Classes:
CompoundTriggerAdvice
,RotatingServerAdvice
,SimpleActiveIdleReceiveMessageAdvice
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An AOP advice to perform hooks before and/or after a
receive()
contract is called.- Since:
- 5.3
- Author:
- Artem Bilan
-
Method Summary
Modifier and TypeMethodDescriptionMessage<?>
afterReceive
(Message<?> result, Object source) Subclasses can take actions based on the result of theJoinpoint.proceed()
; e.g.default boolean
beforeReceive
(Object source) Subclasses can decide whether toJoinpoint.proceed()
or not.default Object
invoke
(MethodInvocation invocation)
-
Method Details
-
beforeReceive
Subclasses can decide whether toJoinpoint.proceed()
or not.- Parameters:
source
- the source of the message to receive.- Returns:
- true to proceed (default).
-
invoke
- Specified by:
invoke
in interfaceMethodInterceptor
- Throws:
Throwable
-
afterReceive
Subclasses can take actions based on the result of theJoinpoint.proceed()
; e.g. adjust thetrigger
. The message can also be replaced with a new one.- Parameters:
result
- the received message.source
- the source of the message to receive.- Returns:
- a message to continue to process the result, null to discard whatever
the
Joinpoint.proceed()
returned.
-