Interface QueryChannel

  • All Known Implementing Classes:
    QueryChannelImpl

    public interface QueryChannel
    Communication channel with AxonServer for Query related interactions.
    • Method Detail

      • registerQueryHandler

        Registration registerQueryHandler​(QueryHandler handler,
                                          QueryDefinition... queryTypes)
        Registers the given handler to handle incoming queries defined through the given queryTypes. Duplicate handlers can be registered.
        Parameters:
        handler - the handler to handle incoming queries with
        queryTypes - the QueryDefinitions to register the handler for
        Returns:
        a registration which allows the query handler to be deregistered
      • subscriptionQuery

        SubscriptionQueryResult subscriptionQuery​(QueryRequest query,
                                                  int bufferSize,
                                                  int fetchSize)
        Sends out a subscription query to AxonServer for routing to the appropriate handler. Allows for receiving an initial query result followed by a stream of updates.
        Parameters:
        query - the subscription QueryRequest to send
        bufferSize - the number of updates to be buffered by the update result stream
        fetchSize - the number of updates to be consumed from the update stream prior to refilling it
        Returns:
        the SubscriptionQueryResult containing the initial result and update stream
      • subscriptionQuery

        @Deprecated(since="2025.2.0")
        default SubscriptionQueryResult subscriptionQuery​(QueryRequest query,
                                                          SerializedObject updateType,
                                                          int bufferSize,
                                                          int fetchSize)
        Deprecated.
        in favor of subscriptionQuery(QueryRequest, int, int). UpdateType is not used.
        Sends out a subscription query to AxonServer for routing to the appropriate handler. Allows for receiving an initial query result followed by a stream of updates.
        Parameters:
        query - the subscription QueryRequest to send
        updateType - the type of updates expected from this subscription query
        bufferSize - the number of updates to be buffered by the update result stream
        fetchSize - the number of updates to be consumed from the update stream prior to refilling it
        Returns:
        the SubscriptionQueryResult containing the initial result and update stream
      • prepareDisconnect

        CompletableFuture<Void> prepareDisconnect()
        Prepares this QueryChannel to disconnect, by unsubscribing all registered query handlers. Will wait with a certain cut off until all acknowledgments of unsubscribing have been received.

        This method should be used if a connected client wants to disconnect from AxonServer.

        Returns:
        a CompletableFuture of Void to react when all query handlers have been unsubscribed