public final class PublisherImpl extends ProxyService implements SequencedPublisher<Offset>, RetryingConnectionObserver<MessagePublishResponse>
| Constructor and Description |
|---|
PublisherImpl(StreamFactories.PublishStreamFactory streamFactory,
InitialPublishRequest initialRequest,
com.google.api.gax.batching.BatchingSettings batchingSettings) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancelOutstandingPublishes()
Attempts to cancel all outstanding publishes.
|
void |
flush() |
protected void |
handlePermanentError(CheckedApiException error) |
void |
onClientResponse(MessagePublishResponse publishResponse) |
com.google.api.core.ApiFuture<Offset> |
publish(Message message,
PublishSequenceNumber sequenceNumber)
Publish a new message with an assigned sequence number.
|
protected void |
start() |
protected void |
stop() |
void |
triggerReinitialize(CheckedApiException streamError) |
addServices, addServices, doStart, doStop, onPermanentErroraddListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, failureCause, isRunning, notifyFailed, notifyStarted, notifyStopped, startAsync, state, stopAsyncpublic PublisherImpl(StreamFactories.PublishStreamFactory streamFactory, InitialPublishRequest initialRequest, com.google.api.gax.batching.BatchingSettings batchingSettings) throws com.google.api.gax.rpc.ApiException
com.google.api.gax.rpc.ApiExceptionpublic void triggerReinitialize(CheckedApiException streamError)
triggerReinitialize in interface RetryingConnectionObserver<MessagePublishResponse>protected void handlePermanentError(CheckedApiException error)
handlePermanentError in class ProxyServiceprotected void start()
start in class ProxyServiceprotected void stop()
stop in class ProxyServicepublic com.google.api.core.ApiFuture<Offset> publish(Message message, PublishSequenceNumber sequenceNumber)
SequencedPublisherBehavior is undefined if a call to flush() is outstanding or close() has already been called. This method never blocks.
Guarantees that if a single publish future has an exception set, all publish calls made after that will also have an exception set.
publish in interface SequencedPublisher<Offset>public void cancelOutstandingPublishes()
SequencedPublishercancelOutstandingPublishes in interface SequencedPublisher<Offset>public void onClientResponse(MessagePublishResponse publishResponse) throws CheckedApiException
onClientResponse in interface RetryingConnectionObserver<MessagePublishResponse>CheckedApiExceptionCopyright © 2023 Google LLC. All rights reserved.