Interface MessageInterceptor

All Known Implementing Classes:
InterceptorChain, JournalingInterceptor, MessageFilter, MethodInvokingMessageInterceptor, SubscriptionInterceptor
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 MessageInterceptor
Message interceptors are used to intercept messages before they are sent or received by message endpoints.

MessageInterceptors will usually be chained using a InterceptorChain.

A MessageInterceptor can be used in different ways like, for example:

...and many other.

Message Filter

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Intercept a message and return the same message, a modified version of the incoming message, or null, if the message should be filtered out and dropped by the AbstractMessageEndpoint
  • Method Details

    • intercept

      @Nullable TextMessage intercept(@Nonnull TextMessage message)
      Intercept a message and return the same message, a modified version of the incoming message, or null, if the message should be filtered out and dropped by the AbstractMessageEndpoint
      Parameters:
      message - the channel-layer message with payload-type beeing a String
      Returns:
      intercepted version of the message, or null if the message should be dropped.