Annotation Interface MessageHandler
@Documented
@Retention(RUNTIME)
@Target({METHOD,ANNOTATION_TYPE})
@HasHandlerAttributes
public @interface MessageHandler
Annotation indicating that a member method should be able to respond to
Messages.
It is not recommended to put this annotation on methods or constructors directly. Instead, put this annotation on another annotation that expresses the type of message handled.
- Since:
- 3.0.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 the function annotated with@MessageHandler.
- 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 payload type handled by the function annotated with
@MessageHandler.
- Default:
java.lang.Object.class
-