Package de.otto.synapse.annotation
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<String> 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.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.StringchannelNamePatternThe optional regexp pattern used to select channels by name.EndpointType[]endpointTypeThe optionalEndpointType(s) that will be intercepted.
-
Element Details
-
channelNamePattern
java.lang.String channelNamePatternThe optional regexp pattern used to select channels by name.By default, all channels will be intercepted.
- Returns:
- regexp
- Default:
- ".*"
-
endpointType
EndpointType[] endpointTypeThe optionalEndpointType(s) that will be intercepted.By default, both
EndpointType.SENDERandEndpointType.RECEIVERendpoints will be intercepted.- Returns:
- intercepted
EndpointType(s)
- Default:
- {SENDER, RECEIVER}
-