Interface InstructionAckSource<T>

Type Parameters:
T - the type of message to be sent
All Known Implementing Classes:
DefaultInstructionAckSource
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface InstructionAckSource<T>
Responsible for sending instruction acknowledgements.
Since:
4.2.1
Author:
Milan Savic
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    sendAck(String instructionId, boolean success, io.axoniq.axonserver.grpc.ErrorMessage error, io.grpc.stub.StreamObserver<T> stream)
    Sends an acknowledgement.
    default void
    sendSuccessfulAck(String instructionId, io.grpc.stub.StreamObserver<T> stream)
    Sends successful acknowledgement.
    default void
    sendUnsuccessfulAck(String instructionId, io.axoniq.axonserver.grpc.ErrorMessage error, io.grpc.stub.StreamObserver<T> stream)
    Sends unsuccessful acknowledgement.
    default void
    sendUnsupportedInstruction(String instructionId, String source, io.grpc.stub.StreamObserver<T> stream)
    Sends acknowledgement of unsupported instruction.
  • Method Details

    • sendSuccessfulAck

      default void sendSuccessfulAck(String instructionId, io.grpc.stub.StreamObserver<T> stream)
      Sends successful acknowledgement.
      Parameters:
      instructionId - identifier of successful instruction. If null, acknowledgement will not be sent.
      stream - the stream for sending acknowledgements
    • sendUnsupportedInstruction

      default void sendUnsupportedInstruction(String instructionId, String source, io.grpc.stub.StreamObserver<T> stream)
      Sends acknowledgement of unsupported instruction.
      Parameters:
      instructionId - identifier of successful instruction. If null, acknowledgement will not be sent.
      source - the location where error occurred
      stream - the stream for sending acknowledgements
    • sendUnsuccessfulAck

      default void sendUnsuccessfulAck(String instructionId, io.axoniq.axonserver.grpc.ErrorMessage error, io.grpc.stub.StreamObserver<T> stream)
      Sends unsuccessful acknowledgement.
      Parameters:
      instructionId - identifier of successful instruction. If null, acknowledgement will not be sent.
      error - the cause of the error
      stream - the stream for sending acknowledgements
    • sendAck

      void sendAck(String instructionId, boolean success, io.axoniq.axonserver.grpc.ErrorMessage error, io.grpc.stub.StreamObserver<T> stream)
      Sends an acknowledgement.
      Parameters:
      instructionId - identifier of successful instruction. If null, acknowledgement will not be sent.
      success - true if acknowledgement is successful, false otherwise
      error - the cause of the error. Provide null for successful acknowledgement
      stream - the stream for sending acknowledgements