class QueryService extends QueryServiceGrpc.QueryServiceImplBase implements AxonServerClientService {

    @Override
    public void query(QueryRequest request, StreamObserver<QueryResponse> responseObserver) {
        if (logger.isTraceEnabled()) {
            logger.trace("{}: Received query: {}", request.getClientId(), request.getQuery());
        }
        GrpcQueryResponseConsumer responseConsumer = new GrpcQueryResponseConsumer(responseObserver);
        queryDispatcher.query(new SerializedQuery(contextProvider.getContext(), request),
                              responseConsumer::onNext,
                              result -> responseConsumer.onCompleted());
    }

    public  QueryService(Topology topology, QueryDispatcher queryDispatcher, ContextProvider contextProvider,
                        ClientIdRegistry clientIdRegistry,
                        ApplicationEventPublisher eventPublisher,
                        @Qualifier("queryInstructionAckSource")
                                InstructionAckSource<QueryProviderInbound> instructionAckSource);

}