Annotation 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 Elements
    Modifier and Type
    Optional Element
    Description
    Class<? extends Message>
    Specifies the type of message that can be handled by the member method.
    Specifies the type of message payload that can be handled by the member method.
  • Element Details

    • messageType

      Class<? extends Message> messageType
      Specifies the type of message that can be handled by the member method. Defaults to any Message.
      Returns:
      The type of Message handled by the function annotated with @MessageHandler.
      Default:
      org.axonframework.messaging.core.Message.class
    • payloadType

      Class<?> payloadType
      Specifies 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 any Object.
      Returns:
      The payload type handled by the function annotated with @MessageHandler.
      Default:
      java.lang.Object.class