Interface MessageSourceMutator
- All Superinterfaces:
Advice
,Interceptor
,MethodInterceptor
,ReceiveMessageAdvice
- All Known Implementing Classes:
AbstractMessageSourceAdvice
,CompoundTriggerAdvice
,RotatingServerAdvice
,SimpleActiveIdleMessageSourceAdvice
- 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 MessageSourceMutator extends ReceiveMessageAdvice
A
ReceiveMessageAdvice
extension that can mutate a MessageSource
before and/or after
MessageSource.receive()
is called.- Since:
- 5.0.7
- Author:
- Gary Russell, Artem Bilan
-
Method Summary
Modifier and Type Method Description default Message<?>
afterReceive(Message<?> result, Object source)
Subclasses can take actions based on the result of theJoinpoint.proceed()
; e.g.Message<?>
afterReceive(Message<?> result, MessageSource<?> source)
Subclasses can take actions based on the result of the poll; e.g.default boolean
beforeReceive(Object source)
Subclasses can decide whether toJoinpoint.proceed()
or not.default boolean
beforeReceive(MessageSource<?> source)
Subclasses can decide whether to proceed with this poll.
-
Method Details
-
beforeReceive
Description copied from interface:ReceiveMessageAdvice
Subclasses can decide whether toJoinpoint.proceed()
or not.- Specified by:
beforeReceive
in interfaceReceiveMessageAdvice
- Parameters:
source
- the source of the message to receive.- Returns:
- true to proceed (default).
-
beforeReceive
Subclasses can decide whether to proceed with this poll.- Parameters:
source
- the message source.- Returns:
- true to proceed (default).
-
afterReceive
Description copied from interface:ReceiveMessageAdvice
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.- Specified by:
afterReceive
in interfaceReceiveMessageAdvice
- 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.
-
afterReceive
Subclasses can take actions based on the result of the poll; e.g. adjust thetrigger
. The message can also be replaced with a new one.- Parameters:
result
- the received message.source
- the message source.- Returns:
- a message to continue to process the result, null to discard whatever the poll returned.
-