@QueryHandler. The declared parameters of the method define which messages it will receive.
@QueryHandlerannotated methods allow the following parameter types:
QueryMessage, if the
@QueryHandlerannotation explicitly defined the name of the Query the handler can process. By default, a Query name is the fully qualified class name of the Query's payload.
@MetaDataValuewill resolve to the Meta Data value with the key as indicated on the annotation. If
nullis passed when the meta data value is not present. If
true, the resolver will not match and prevent the method from being invoked when the meta data value is not present.
MetaDatawill have the entire
UnitOfWorkget the current Unit of Work injected. This allows query handlers to register actions to be performed at specific stages of the Unit of Work, or gain access to the resources registered with it.
QueryMessagewill get the complete message, with both the payload and the Meta Data. This is useful if a method needs several meta data fields, or other properties of the wrapping Message.
ParameterResolvers by implementing the
ParameterResolverFactoryinterface and creating a file named
/META-INF/service/org.axonframework.common.annotation.ParameterResolverFactorycontaining the fully qualified name of the implementing class. See Advanced Customizations for details.
this.getClass()), all annotated methods are evaluated
SubHandlerwill be invoked for queries for
MyResult; the handler methods of
TopHandlerare invoked for queries for