Interface QueryHandlingModule
- All Superinterfaces:
Module,ModuleBuilder<QueryHandlingModule>
A
Module and ModuleBuilder implementation providing operation to construct a query handling
application module.
The QueryHandlingModule follows a builder paradigm, wherein several QueryHandlers can be
registered in either order.
To register query handlers, a similar registration phase switch should be made, by invoking
QueryHandlingModule.SetupPhase.queryHandlers().
Here's an example of how to register two query handler lambdas:
QueryHandlingModule.named("my-module")
.queryHandlers()
.queryHandler(new QualifiedName(FetchClasses.class),
new QualifiedName(Classes.class),
(query, context) -> { ...query handling logic... })
.queryHandler(new QualifiedName(FindStudentForName.class),
new QualifiedName(Student.class),
(query, context) -> { ...query handling logic... });
Note that users do not have to invoke ModuleBuilder.build() themselves when using this interface, as the
ApplicationConfigurer takes care of that.
- Since:
- 5.0.0
- Author:
- Steven van Beelen
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThe query handler configuration phase of the query handling module.static interfaceThe setup phase of the query handling module. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionStarts aQueryHandlingModulemodule with the givenmoduleName.Methods inherited from interface org.axonframework.common.configuration.ModuleBuilder
build
-
Method Details
-
named
Starts aQueryHandlingModulemodule with the givenmoduleName.- Parameters:
moduleName- The name of theQueryHandlingModuleunder construction.- Returns:
- The setup phase of this module, for a fluent API.
-