@FunctionalInterface public interface QueryHandler
| Modifier and Type | Interface and Description |
|---|---|
static interface |
QueryHandler.UpdateHandler
Interface describing a stream of updates to a subscription query.
|
| Modifier and Type | Method and Description |
|---|---|
void |
handle(QueryRequest query,
ReplyChannel<QueryResponse> responseHandler)
Handle the given
query, using given responseHandler to send the response(s). |
default Registration |
registerSubscriptionQuery(SubscriptionQuery query,
QueryHandler.UpdateHandler updateHandler)
Registers an incoming subscription query request, represented by given
query, using given updateHandler to send updates when the projection for this query changes. |
default FlowControl |
stream(QueryRequest query,
ReplyChannel<QueryResponse> responseHandler)
Handle the given
query, using the given responseHandler to send the response(s). |
void handle(QueryRequest query, ReplyChannel<QueryResponse> responseHandler)
query, using given responseHandler to send the response(s).
Note that the query must be completed using ReplyChannel.complete() or ReplyChannel.sendLast(Object).
query - the message representing the query requestresponseHandler - to handler to send responses withdefault FlowControl stream(QueryRequest query, ReplyChannel<QueryResponse> responseHandler)
query, using the given responseHandler to send the response(s). This operation
is flow control aware, hence messages should be sent via responseHandler when requested.
Note that the query must be completed using ReplyChannel.complete() or ReplyChannel.sendLast(Object).
query - the message representing the query requestresponseHandler - the handler to send responses withFlowControl to request more responses and cancel sending responsesdefault Registration registerSubscriptionQuery(SubscriptionQuery query, QueryHandler.UpdateHandler updateHandler)
query, using given updateHandler to send updates when the projection for this query changes.
If this handler doesn't support subscription queries for the given query, it should return null.
Otherwise, it must return a handle that can be used to cancel the subscription query.
query - the message representing the queryupdateHandler - to handler to send updates withnull if this handler doesn't support the
subscription queryCopyright © 2020–2022 AxonIQ BV. All rights reserved.