Class FlowControllingStreamObserver<T>

java.lang.Object
org.axonframework.axonserver.connector.util.FlowControllingStreamObserver<T>
All Implemented Interfaces:
io.grpc.stub.StreamObserver<T>

@Deprecated public class FlowControllingStreamObserver<T> extends Object implements io.grpc.stub.StreamObserver<T>
Deprecated.
in through use of the AxonServer java connector
Wrapper around the standard StreamObserver that guarantees that the onNext calls are executed in a thread-safe manner. Also maintains flow control sending a new message with permits to AxonServer when it is ready to handle more messages
Since:
4.0
Author:
Marc Gathier
  • Constructor Details

    • FlowControllingStreamObserver

      public FlowControllingStreamObserver(io.grpc.stub.StreamObserver<T> wrappedStreamObserver, AxonServerConfiguration configuration, Function<io.axoniq.axonserver.grpc.FlowControl,T> requestWrapper, Predicate<T> isConfirmationMessage)
      Deprecated.
      Parameters:
      wrappedStreamObserver - stream observer to send messages to AxonServer
      configuration - AxonServer configuration for flow control
      requestWrapper - Function to create a new permits request
      isConfirmationMessage - predicate to test if the message sent to AxonServer is a confirmation message
    • FlowControllingStreamObserver

      public FlowControllingStreamObserver(io.grpc.stub.StreamObserver<T> wrappedStreamObserver, String clientId, AxonServerConfiguration.FlowControlConfiguration flowControlConfiguration, Function<io.axoniq.axonserver.grpc.FlowControl,T> requestWrapper, Predicate<T> isConfirmationMessage)
      Deprecated.
      Parameters:
      wrappedStreamObserver - stream observer to send messages to AxonServer
      clientId - ClientId in AxonServer configuration
      flowControlConfiguration - Flow control configuration
      requestWrapper - Function to create a new permits request
      isConfirmationMessage - predicate to test if the message sent to AxonServer is a confirmation message
  • Method Details

    • sendInitialPermits

      public FlowControllingStreamObserver<T> sendInitialPermits()
      Deprecated.
    • onNext

      public void onNext(T t)
      Deprecated.
      Specified by:
      onNext in interface io.grpc.stub.StreamObserver<T>
    • onError

      public void onError(Throwable throwable)
      Deprecated.
      Specified by:
      onError in interface io.grpc.stub.StreamObserver<T>
    • onCompleted

      public void onCompleted()
      Deprecated.
      Specified by:
      onCompleted in interface io.grpc.stub.StreamObserver<T>
    • markConsumed

      public void markConsumed(Integer consumed)
      Deprecated.
      Notifies the stream observer that [@code consumed} messages are processed by the client. Triggers a new permits request when remaining permits is 0.
      Parameters:
      consumed - nr of messages consumed