Interface MessageSourceMutator

All Superinterfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor, ReceiveMessageAdvice
All Known Implementing Classes:
CompoundTriggerAdvice
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
  • Method Summary

    Modifier and Type
    Method
    Description
    default org.springframework.messaging.Message<?>
    afterReceive(org.springframework.messaging.Message<?> result, Object source)
    Subclasses can take actions based on the result of the Joinpoint.proceed(); e.g.
    org.springframework.messaging.Message<?>
    afterReceive(org.springframework.messaging.Message<?> result, MessageSource<?> source)
    Subclasses can take actions based on the result of the poll; e.g.
    default boolean
    Subclasses can decide whether to Joinpoint.proceed() or not.
    default boolean
    Subclasses can decide whether to proceed with this poll.

    Methods inherited from interface org.springframework.integration.aop.ReceiveMessageAdvice

    invoke
  • Method Details

    • beforeReceive

      default boolean beforeReceive(Object source)
      Description copied from interface: ReceiveMessageAdvice
      Subclasses can decide whether to Joinpoint.proceed() or not.
      Specified by:
      beforeReceive in interface ReceiveMessageAdvice
      Parameters:
      source - the source of the message to receive.
      Returns:
      true to proceed (default).
    • beforeReceive

      default boolean beforeReceive(MessageSource<?> source)
      Subclasses can decide whether to proceed with this poll.
      Parameters:
      source - the message source.
      Returns:
      true to proceed (default).
    • afterReceive

      @Nullable default org.springframework.messaging.Message<?> afterReceive(@Nullable org.springframework.messaging.Message<?> result, Object source)
      Description copied from interface: ReceiveMessageAdvice
      Subclasses can take actions based on the result of the Joinpoint.proceed(); e.g. adjust the trigger. The message can also be replaced with a new one.
      Specified by:
      afterReceive in interface ReceiveMessageAdvice
      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

      @Nullable org.springframework.messaging.Message<?> afterReceive(@Nullable org.springframework.messaging.Message<?> result, MessageSource<?> source)
      Subclasses can take actions based on the result of the poll; e.g. adjust the trigger. 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.