Global

Members

(constant) gapicConfig

Client JSON configuration object, loaded from src/v1/publisher_client_config.json. This file defines retry strategy and timeouts for all API methods in this library.

(constant) gapicConfig

Client JSON configuration object, loaded from src/v1/schema_service_client_config.json. This file defines retry strategy and timeouts for all API methods in this library.

(constant) gapicConfig

Client JSON configuration object, loaded from src/v1/subscriber_client_config.json. This file defines retry strategy and timeouts for all API methods in this library.

(constant) libraryTracer

Methods

createSpan(spanName, attributesnullable, parentnullable)

Creates a new span with the given properties

Parameters:
Name Type Attributes Description
spanName string

the name for the span

attributes Attributes <nullable>

an object containing the attributes to be set for the span

parent SpanContext <nullable>

the context of the parent span to link to the span

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 GCLOUD_PROJECT for your project ID. If your app is running in an environment which supports Application Default Credentials, your project ID will be detected automatically.

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 projectId option above is not necessary. NOTE: .pem and .p12 require you to specify the email option as well.

apiEndpoint string <optional>

The apiEndpoint from options will set the host. If not set, the PUBSUB_EMULATOR_HOST environment variable from the gcloud SDK is honored. We also check the CLOUD_API_ENDPOINT_OVERRIDES_PUBSUB environment variable used by gcloud alpha pubsub. Otherwise the actual API endpoint will be used. Note that if the URL doesn't end in '.googleapis.com', we will assume that it's an emulator and disable strict SSL checks.

email string <optional>

Account email address. Required when using a .pem or .p12 keyFilename.

credentials object <optional>

Credentials object.

Properties
Name Type Attributes Description
client_email string <optional>
private_key string <optional>
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 ttl. The definition of "activity" depends on the type of the associated resource. The minimum and maximum allowed values for ttl depend on the type of the associated resource, as well. If ttl is not set, the associated resource never expires.

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.

maxExtensionMinutes number <optional>
60

The maximum duration (in minutes) to extend the message deadline before redelivering.

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.