Annotation Type MessageInterceptor


@Target(METHOD)
@Retention(RUNTIME)
@Documented
public @interface MessageInterceptor
An annotation that marks a method to be used as a MessageInterceptor.

The annotated method must expect a single argument with parameter type TextMessage, or Message<String>. The return type can either be Textmessage, Message&lt;String&gt; or void.

MessageInterceptors can be used as MessageFilter: If the annotated method is returning null, the intercepted message will be dropped, without sending and/or processing it.

Processing of @MessageInterceptor annotations is performed by a MessageInterceptorBeanPostProcessor that is auto-configured in SynapseAutoConfiguration.

See Also:
TextMessage, MessageInterceptor, MessageInterceptorBeanPostProcessor
  • Optional Element Summary

    Optional Elements
    Modifier and Type Optional Element Description
    java.lang.String channelNamePattern
    The optional regexp pattern used to select channels by name.
    EndpointType[] endpointType
    The optional EndpointType(s) that will be intercepted.
  • Element Details

    • channelNamePattern

      java.lang.String channelNamePattern
      The optional regexp pattern used to select channels by name.

      By default, all channels will be intercepted.

      Returns:
      regexp
      Default:
      ".*"
    • endpointType

      EndpointType[] endpointType
      The optional EndpointType(s) that will be intercepted.

      By default, both EndpointType.SENDER and EndpointType.RECEIVER endpoints will be intercepted.

      Returns:
      intercepted EndpointType(s)
      Default:
      {SENDER, RECEIVER}