Annotation Interface HandleQuery
@Documented
@Retention(RUNTIME)
@Target({METHOD,CONSTRUCTOR})
@HandleMessage(QUERY)
public @interface HandleQuery
Marks a method or constructor as a handler for query messages (
MessageType.QUERY).
Query handlers are responsible for answering questions, typically by returning a computed or retrieved value.
The returned result is published to the result log unless the handler is marked passive.
This annotation is a concrete specialization of HandleMessage for queries.
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionClass<?>[]Restricts which payload types this handler may be invoked for.booleanIftrue, disables this handler during discovery.booleanIftrue, this handler is considered passive and will not emit a result message.booleanIftrue, indexed request messages whose effective timeout has already expired may be skipped before this handler is invoked.
-
Element Details
-
disabled
boolean disabledIftrue, disables this handler during discovery.- Default:
false
-
passive
boolean passiveIftrue, this handler is considered passive and will not emit a result message. Useful when the handler is for side effects only.- Default:
false
-
skipExpiredRequests
boolean skipExpiredRequestsIftrue, indexed request messages whose effective timeout has already expired may be skipped before this handler is invoked.Defaults to
truebecause stale query responses are usually no longer useful. Set tofalsefor queries that should still be processed during replay or after the original sender timed out.- Default:
true
-
allowedClasses
Class<?>[] allowedClassesRestricts which payload types this handler may be invoked for.- Default:
{}
-