Annotation Interface MessageHandlerInterceptor
@MessageHandler
@Retention(RUNTIME)
@Target({METHOD,ANNOTATION_TYPE})
public @interface MessageHandlerInterceptor
Annotation marking a handler method as an interceptor handler. Unlike regular handlers, interceptor handlers are
chained and do not block processing by other handlers. They can be used to add processing behavior either before,
after or both before and after processing of other handlers.
When parameters of an interceptor do not match the message, this will prevent the invocation of this handler, but it will not block processing of any other handlers that do match.
- Since:
- 4.4.0
- Author:
- Allard Buijze
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionSpecifies the type of message that can be handled by the member method.Class<?> Specifies the type of message payload that can be handled by the member method.
-
Element Details
-
messageType
Specifies the type of message that can be handled by the member method. Defaults to anyMessage.- Returns:
- The type of
Messagehandled by function annotated with@MessageHandlerInterceptor.
- Default:
org.axonframework.messaging.core.Message.class
-
payloadType
Class<?> payloadTypeSpecifies the type of message payload that can be handled by the member method. The payload of the message should be assignable to this type. Defaults to anyObject.- Returns:
- The type of
Message.payload()handled by the function annotated with@MessageHandlerInterceptor.
- Default:
java.lang.Object.class
-