Class AbstractAxonServerChannel<OUT>

    • Method Detail

      • sendInstruction

        protected CompletableFuture<Void> sendInstruction​(OUT instruction,
                                                          Function<OUT,​String> instructionIdProvider,
                                                          io.grpc.stub.StreamObserver<OUT> outboundStream)
        Send the given instruction over the given outboundStream. Will use the given instructionIdProvider to retrieve the instruction identifier to keep track when the instruction has been acknowledged.
        Parameters:
        instruction - the instruction of type OUT to send
        instructionIdProvider - extraction function retrieving the instruction identifier from the given instruction
        outboundStream - StreamObserver to send the given instruction over
        Returns:
        a CompletableFuture resolving successfully or exceptionally depending on the outcome of the dispatched instruction
      • scheduleReconnect

        protected void scheduleReconnect​(Throwable disconnectReason)
        Schedule an attempt to reconnect with AxonServer. Depending on the disconnectReason, the reconnect attempt will be executed within 500ms or 5000ms.
        Parameters:
        disconnectReason - The reason why the previous connection failed.
      • scheduleImmediateReconnect

        protected void scheduleImmediateReconnect()
        Schedule an immediate attempt to reconnect with AxonServer.
      • connect

        public abstract void connect()
        Connect this channel with AxonServer.
      • reconnect

        public abstract void reconnect()
        Reconnect this channel with AxonServer.
      • disconnect

        public abstract void disconnect()
        Disconnect this channel from AxonServer.
      • isReady

        public abstract boolean isReady()
        Validate whether this channel has all required streams connected with AxonServer. If the state of the channel does not require any active streams, it is considered ready and will return true.
        Returns:
        true if this channel is connected with AxonServer or does not require any active connections, false otherwise