Class PubSubSubscriberOptions
- All Implemented Interfaces:
Serializable
Set via PubSubSourceBuilder.subscriberOptions(PubSubSubscriberOptions); optional —
every knob left unset keeps the SDK's (or the source's) default behavior, so defaults()
is equivalent to not setting options at all.
SDK flow control limits what its subscriber holds while acknowledgement deadlines are still
extended. That limit lapses after PubSubSubscriberOptions.Builder.maxAckExtensionPeriod(Duration) when nothing
drains, so the source also enforces a reader-wide hard bound through PubSubSubscriberOptions.Builder.subscriberBufferMaxMessages(long) and PubSubSubscriberOptions.Builder.subscriberBufferMaxBytes(long). A
separate per-split bound parks subscribers paused by watermark alignment through PubSubSubscriberOptions.Builder.pausedSplitBufferMaxMessages(long) and PubSubSubscriberOptions.Builder.pausedSplitBufferMaxBytes(long).
The source still acknowledges emitted records only after checkpoint completion.
The subscriber shutdown mode is deliberately not a knob. It is fixed to
NACK_IMMEDIATELY so that closing a reader releases messages at once; the SDK's
WAIT_FOR_PROCESSING default would wait for acknowledgements that only arrive at checkpoint
completion, which never happens during shutdown. Only PubSubSubscriberOptions.Builder.shutdownTimeout(Duration)
is configurable.
Instances are immutable and serializable.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a newPubSubSubscriberOptions.Builder.static PubSubSubscriberOptionsdefaults()Returns the default options: every knob left wherePubSubSubscriberOptions.Builderinitialises it, which is the SDK's own default wherever the source has no reason to pick one.booleanReturns how long a completed checkpoint waits for its acknowledgements to be confirmed, ornullwhen acknowledgement is fire-and-forget.Returns how long the reader waits for its first checkpoint before failing the job, orDuration.ZEROwhen the watchdog is disabled.Returns the flow-control outstanding-message limit, ornullfor the SDK default.Returns the flow-control outstanding-byte limit, ornullfor the SDK default.Returns the total acknowledgement-deadline extension budget, ornullfor the SDK default.Returns the largest single deadline extension, ornullfor the SDK default.intReturns the maximum number of messages drained from one split per fetch.Returns the smallest single deadline extension, ornullfor the SDK default.Returns the streaming-pull connection count, ornullfor the SDK default.Returns the byte cap on a paused split's buffer, ornullfor twice the effective flow-control outstanding-byte limit.Returns the message cap on a paused split's buffer, ornullfor twice the effective flow-control outstanding-message limit.Returns how long closing one subscriber waits for it to release its messages.longReturns the reader-wide hard cap on serialized bytes retained in subscriber buffers.longReturns the reader-wide hard cap on messages retained in subscriber buffers.inthashCode()toString()
-
Method Details
-
builder
Creates a newPubSubSubscriberOptions.Builder.- Returns:
- a new builder
-
defaults
Returns the default options: every knob left wherePubSubSubscriberOptions.Builderinitialises it, which is the SDK's own default wherever the source has no reason to pick one.The values themselves are on the
reference/pubsub.mdtable, one row per setter, rather than enumerated here.- Returns:
- the default options
-
getFlowControlMaxOutstandingElementCount
Returns the flow-control outstanding-message limit, ornullfor the SDK default. -
getFlowControlMaxOutstandingRequestBytes
Returns the flow-control outstanding-byte limit, ornullfor the SDK default. -
getSubscriberBufferMaxMessages
public long getSubscriberBufferMaxMessages()Returns the reader-wide hard cap on messages retained in subscriber buffers. -
getSubscriberBufferMaxBytes
public long getSubscriberBufferMaxBytes()Returns the reader-wide hard cap on serialized bytes retained in subscriber buffers. -
getPausedSplitBufferMaxMessages
Returns the message cap on a paused split's buffer, ornullfor twice the effective flow-control outstanding-message limit. -
getPausedSplitBufferMaxBytes
Returns the byte cap on a paused split's buffer, ornullfor twice the effective flow-control outstanding-byte limit. -
getParallelPullCount
Returns the streaming-pull connection count, ornullfor the SDK default. -
getMaxAckExtensionPeriod
Returns the total acknowledgement-deadline extension budget, ornullfor the SDK default. -
getMinDurationPerAckExtension
Returns the smallest single deadline extension, ornullfor the SDK default. -
getMaxDurationPerAckExtension
Returns the largest single deadline extension, ornullfor the SDK default. -
getAwaitAckConfirmation
Returns how long a completed checkpoint waits for its acknowledgements to be confirmed, ornullwhen acknowledgement is fire-and-forget. -
getShutdownTimeout
Returns how long closing one subscriber waits for it to release its messages. -
getMaxRecordsPerFetch
public int getMaxRecordsPerFetch()Returns the maximum number of messages drained from one split per fetch. -
getFirstCheckpointTimeout
Returns how long the reader waits for its first checkpoint before failing the job, orDuration.ZEROwhen the watchdog is disabled. -
equals
-
hashCode
public int hashCode() -
toString
-