Interface ReceiveMessageAdvice
- All Superinterfaces:
org.aopalliance.aop.Advice,org.aopalliance.intercept.Interceptor,org.aopalliance.intercept.MethodInterceptor
- All Known Subinterfaces:
MessageSourceMutator
- All Known Implementing Classes:
CompoundTriggerAdvice,SimpleActiveIdleReceiveMessageAdvice
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface ReceiveMessageAdvice
extends org.aopalliance.intercept.MethodInterceptor
An AOP advice to perform hooks before and/or after a
receive() contract is called.- Since:
- 5.3
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.messaging.Message<?>afterReceive(org.springframework.messaging.Message<?> result, Object source) Subclasses can take actions based on the result of theJoinpoint.proceed(); e.g.default booleanbeforeReceive(Object source) Subclasses can decide whether toJoinpoint.proceed()or not.default Objectinvoke(org.aopalliance.intercept.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
@Nullable default Object invoke(org.aopalliance.intercept.MethodInvocation invocation) throws Throwable - Specified by:
invokein interfaceorg.aopalliance.intercept.MethodInterceptor- Throws:
Throwable
-
afterReceive
@Nullable org.springframework.messaging.Message<?> afterReceive(@Nullable org.springframework.messaging.Message<?> result, Object source) 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.
-