Class SubscriberImpl (1.12.22)

public class SubscriberImpl extends ProxyService implements Subscriber, RetryingConnectionObserver<List<SequencedMessage>>

Inheritance

java.lang.Object > AbstractApiService > ProxyService > SubscriberImpl

Implements

Subscriber, com.google.cloud.pubsublite.internal.wire.RetryingConnectionObserver<java.util.List<com.google.cloud.pubsublite.proto.SequencedMessage>>

Constructors

SubscriberImpl(StreamFactories.SubscribeStreamFactory streamFactory, InitialSubscribeRequest baseInitialRequest, SeekRequest initialLocation, Consumer<List<SequencedMessage>> messageConsumer, SubscriberResetHandler resetHandler, boolean retryStreamRaces)

public SubscriberImpl(StreamFactories.SubscribeStreamFactory streamFactory, InitialSubscribeRequest baseInitialRequest, SeekRequest initialLocation, Consumer<List<SequencedMessage>> messageConsumer, SubscriberResetHandler resetHandler, boolean retryStreamRaces)
Parameters
NameDescription
streamFactoryStreamFactories.SubscribeStreamFactory
baseInitialRequestInitialSubscribeRequest
initialLocationSeekRequest
messageConsumerConsumer<List<SequencedMessage>>
resetHandlerSubscriberResetHandler
retryStreamRacesboolean

Methods

allowFlow(FlowControlRequest clientRequest)

public void allowFlow(FlowControlRequest clientRequest)
Parameter
NameDescription
clientRequestFlowControlRequest
Exceptions
TypeDescription
CheckedApiException

handlePermanentError(CheckedApiException error)

protected void handlePermanentError(CheckedApiException error)
Parameter
NameDescription
errorCheckedApiException
Overrides

onClientResponse(List<SequencedMessage> messages)

public void onClientResponse(List<SequencedMessage> messages)
Parameter
NameDescription
messagesList<SequencedMessage>
Exceptions
TypeDescription
CheckedApiException

reset()

public void reset()

start()

protected void start()
Overrides

stop()

protected void stop()
Overrides

triggerReinitialize(CheckedApiException streamError)

public void triggerReinitialize(CheckedApiException streamError)
Parameter
NameDescription
streamErrorCheckedApiException