@QueryHandler
. The declared parameters of the method define which messages it will receive.@QueryHandler
annotated methods allow the following parameter types:Message
or QueryMessage
, if the @QueryHandler
annotation 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.@MetaDataValue
will resolve to the Meta Data value with the key as indicated on the annotation. If required
is false
(default), null
is passed when the meta data value is not present. If required
is true
, the resolver will not match and prevent the method from being invoked when the meta data value is not present.MetaData
will have the entire MetaData
of a QueryMessage
injected.UnitOfWork
get 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.Message
, or QueryMessage
will 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.ParameterResolver
s by implementing the ParameterResolverFactory
interface and creating a file named /META-INF/service/org.axonframework.common.annotation.ParameterResolverFactory
containing the fully qualified name of the implementing class. See Advanced Customizations for details.this.getClass()
), all annotated methods are evaluatedSubHandler
will be invoked for queries for QueryB
and result MyResult
; the handler methods of TopHandler
are invoked for queries for QueryA
and QueryC
and result MyResult
.