Members
(constant) FINAL_NACK_TIMEOUT
Specifies how long before the final close timeout, in WaitForProcessing mode, that we should give up and start shutting down cleanly.
OpenTelemetryLevel[undefined]
None: OTel support is not enabled because we found no trace provider, or the user has not enabled it.
OpenTelemetryLevel[undefined]
Modern: We will only inject/extract the modern propagation attribute.
SubscriberCloseBehaviors
Enum values for behaviors of the Subscriber.close() method.
Methods
(async) awaitWithTimeout(promise, timeout)
Awaits on Promise with a timeout. Resolves on the passed promise resolving or rejecting, or on timeout.
Parameters:
| Name | Type | Description |
|---|---|---|
promise |
An existing Promise returning type T. |
|
timeout |
A timeout value as a Duration; if the timeout is exceeded while
waiting for the promise, the Promise this function returns will resolve, but
with |
Returns:
| Type | Description |
|---|---|
|
A TimeoutReturn with the returned value, if applicable, an exception if the promise rejected, or the timedOut set to true if it timed out. |
Type Definitions
BatchOptions
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
callOptions |
object |
<optional> |
Request configuration option, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. |
|
maxMessages |
number |
<optional> |
3000 |
Maximum number of messages allowed in each batch sent. |
maxMilliseconds |
number |
<optional> |
100 |
Maximum duration to wait before sending a batch. Batches can be sent earlier if the maxMessages option is met before the configured duration has passed. |
BatchPublishOptions
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
maxBytes |
number |
<optional> |
1 * 1024 * 1024 |
The maximum number of bytes to buffer before sending a payload. |
maxMessages |
number |
<optional> |
100 |
The maximum number of messages to buffer before sending a payload. |
maxMilliseconds |
number |
<optional> |
10 |
The maximum duration to wait before sending a payload. |
ClientConfig
Properties:
| Name | Type | Attributes | Default | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
projectId |
string |
<optional> |
The project ID from the Google Developer's
Console, e.g. 'grape-spaceship-123'. We will also check the environment
variable |
|||||||||||||
keyFilename |
string |
<optional> |
Full path to the a .json, .pem, or .p12 key
downloaded from the Google Developers Console. If you provide a path to a
JSON file, the |
|||||||||||||
apiEndpoint |
string |
<optional> |
The |
|||||||||||||
email |
string |
<optional> |
Account email address. Required when using a .pem or .p12 keyFilename. |
|||||||||||||
credentials |
object |
<optional> |
Credentials object. Properties
|
|||||||||||||
autoRetry |
boolean |
<optional> |
true |
Automatically retry requests if the response is related to rate limits or certain intermittent server errors. We will exponentially backoff subsequent requests by default. |
||||||||||||
promise |
Constructor |
<optional> |
Custom promise module to use instead of native Promises. |
ExpirationPolicy
A policy that specifies the conditions for this subscription's expiration. A subscription is considered active as long as any connected subscriber is successfully consuming messages from the subscription or is issuing operations on the subscription. If expirationPolicy is not set, a default policy with ttl of 31 days will be used. The minimum allowed value for expirationPolicy.ttl is 1 day.
Properties:
| Name | Type | Description |
|---|---|---|
ttl |
google.protobuf.Duration |
Specifies the "time-to-live"
duration for an associated resource. The resource expires if it is not
active for a period of |
FlowControlOptions
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
allowExcessMessages |
boolean |
<optional> |
true |
PubSub delivers messages in batches with no way to configure the batch size. Sometimes this can be overwhelming if you only want to process a few messages at a time. Setting this option to false will make the client manage any excess messages until you're ready for them. This will prevent them from being redelivered and make the maxMessages option behave more predictably. |
maxBytes |
number |
<optional> |
104857600 |
The desired amount of memory to allow message data to consume. (Default: 100MB) It's possible that this value will be exceeded, since messages are received in batches. |
maxMessages |
number |
<optional> |
1000 |
The desired number of messages to allow in memory before pausing the message stream. Unless allowExcessMessages is set to false, it is very likely that this value will be exceeded since any given message batch could contain a greater number of messages than the desired amount of messages. |
PublishOptions
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
batching |
BatchPublishOptions |
<optional> |
The maximum number of bytes to buffer before sending a payload. |
publisherFlowControl |
FlowControlOptions |
<optional> |
Publisher-side flow control settings. If this is undefined, Ignore will be the assumed action. |
gaxOpts |
object |
<optional> |
Request configuration options, outlined here. |
messageOrdering |
boolean |
<optional> |
If true, messages published with the same order key in Message will be delivered to the subscribers in the order in which they are received by the Pub/Sub system. Otherwise, they may be delivered in any order. |