New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@google-cloud/pubsub

Package Overview
Dependencies
Maintainers
1
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google-cloud/pubsub - npm Package Compare versions

Comparing version

to
1.5.0

15

build/src/default-options.d.ts

@@ -17,6 +17,13 @@ /*!

export declare const defaultOptions: {
maxOutstandingMessages: number;
maxOutstandingBytes: number;
maxExtensionMinutes: number;
maxStreams: number;
subscription: {
maxOutstandingMessages: number;
maxOutstandingBytes: number;
maxExtensionMinutes: number;
maxStreams: number;
};
publish: {
maxOutstandingMessages: number;
maxOutstandingBytes: number;
maxDelayMillis: number;
};
};

@@ -21,13 +21,25 @@ "use strict";

exports.defaultOptions = {
// The maximum number of messages that may be queued for sending.
maxOutstandingMessages: 1000,
// The maximum amount of message data that may be queued for sending,
// in bytes.
maxOutstandingBytes: 100 * 1024 * 1024,
// The maximum number of minutes that a message's lease will ever
// be extended.
maxExtensionMinutes: 60,
// The maximum number of streams/threads that will ever be opened.
maxStreams: 5,
subscription: {
// The maximum number of messages that may be queued for receiving,
// with the default lease manager.
maxOutstandingMessages: 1000,
// The maximum amount of message data that may be queued for receiving,
// in bytes, with the default lease manager.
maxOutstandingBytes: 100 * 1024 * 1024,
// The maximum number of minutes that a message's lease will ever
// be extended.
maxExtensionMinutes: 60,
// The maximum number of subscription streams/threads that will ever
// be opened.
maxStreams: 5,
},
publish: {
// The maximum number of messages we'll batch up for publish().
maxOutstandingMessages: 100,
// The maximum size of the total batched up messages for publish().
maxOutstandingBytes: 1 * 1024 * 1024,
// The maximum time we'll wait to send batched messages, in milliseconds.
maxDelayMillis: 10,
},
};
//# sourceMappingURL=default-options.js.map

@@ -162,5 +162,5 @@ "use strict";

allowExcessMessages: true,
maxBytes: default_options_1.defaultOptions.maxOutstandingBytes,
maxExtension: default_options_1.defaultOptions.maxExtensionMinutes,
maxMessages: default_options_1.defaultOptions.maxOutstandingMessages,
maxBytes: default_options_1.defaultOptions.subscription.maxOutstandingBytes,
maxExtension: default_options_1.defaultOptions.subscription.maxExtensionMinutes,
maxMessages: default_options_1.defaultOptions.subscription.maxOutstandingMessages,
};

@@ -167,0 +167,0 @@ this._options = Object.assign(defaults, options);

@@ -37,3 +37,3 @@ "use strict";

highWaterMark: 0,
maxStreams: default_options_1.defaultOptions.maxStreams,
maxStreams: default_options_1.defaultOptions.subscription.maxStreams,
timeout: 300000,

@@ -40,0 +40,0 @@ };

@@ -21,2 +21,3 @@ "use strict";

const message_queues_1 = require("./message-queues");
const default_options_1 = require("../default-options");
exports.BATCH_LIMITS = {

@@ -126,5 +127,5 @@ maxBytes: Math.pow(1024, 2) * 9,

batching: {
maxBytes: Math.pow(1024, 2) * 5,
maxMessages: 1000,
maxMilliseconds: 100,
maxBytes: default_options_1.defaultOptions.publish.maxOutstandingBytes,
maxMessages: default_options_1.defaultOptions.publish.maxOutstandingMessages,
maxMilliseconds: default_options_1.defaultOptions.publish.maxDelayMillis,
},

@@ -131,0 +132,0 @@ messageOrdering: false,

@@ -23,5 +23,2 @@ "use strict";

exports.RETRY_CODES = [
grpc_js_1.status.OK,
grpc_js_1.status.CANCELLED,
grpc_js_1.status.UNKNOWN,
grpc_js_1.status.DEADLINE_EXCEEDED,

@@ -32,3 +29,2 @@ grpc_js_1.status.RESOURCE_EXHAUSTED,

grpc_js_1.status.UNAVAILABLE,
grpc_js_1.status.DATA_LOSS,
];

@@ -80,2 +76,7 @@ /**

}
if (err.code === grpc_js_1.status.UNAVAILABLE &&
err.details &&
err.details.match(/Server shutdownNow invoked/)) {
return true;
}
return exports.RETRY_CODES.includes(err.code);

@@ -82,0 +83,0 @@ }

@@ -345,7 +345,7 @@ "use strict";

if (options.flowControl) {
const { maxMessages = default_options_1.defaultOptions.maxOutstandingMessages, } = options.flowControl;
const { maxMessages = default_options_1.defaultOptions.subscription.maxOutstandingMessages, } = options.flowControl;
if (!options.streamingOptions) {
options.streamingOptions = {};
}
const { maxStreams = default_options_1.defaultOptions.maxStreams } = options.streamingOptions;
const { maxStreams = default_options_1.defaultOptions.subscription.maxStreams, } = options.streamingOptions;
options.streamingOptions.maxStreams = Math.min(maxStreams, maxMessages);

@@ -352,0 +352,0 @@ }

@@ -85,3 +85,4 @@ // Copyright 2020 Google LLC

* @property {Object.<string, string>} attributes
* Optional attributes for this message.
* Attributes for this message. If this field is empty, the message must
* contain non-empty data.
*

@@ -102,6 +103,8 @@ * @property {string} messageId

* @property {string} orderingKey
* Identifies related messages for which publish order should be respected.
* If a `Subscription` has `enable_message_ordering` set to `true`, messages
* published with the same `ordering_key` value will be delivered to
* subscribers in the order in which they are received by the Pub/Sub system.
* If non-empty, identifies related messages for which publish order should be
* respected. If a `Subscription` has `enable_message_ordering` set to `true`,
* messages published with the same non-empty `ordering_key` value will be
* delivered to subscribers in the order in which they are received by the
* Pub/Sub system. All `PubsubMessage`s published in a given `PublishRequest`
* must specify the same `ordering_key` value.
* <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This

@@ -877,2 +880,10 @@ * API might be changed in backward-incompatible ways and is not recommended

*
* @property {string} clientId
* A unique identifier that is used to distinguish client instances from each
* other. Only needs to be provided on the initial request. When a stream
* disconnects and reconnects for the same stream, the client_id should be set
* to the same value so that state associated with the old stream can be
* transferred to the new stream. The same client_id should not be used for
* different client instances.
*
* @typedef StreamingPullRequest

@@ -907,9 +918,8 @@ * @memberof google.pubsub.v1

* @property {string} name
* Optional user-provided name for this snapshot.
* If the name is not provided in the request, the server will assign a random
* name for this snapshot on the same project as the subscription.
* Note that for REST API requests, you must specify a name. See the
* <a href="https://cloud.google.com/pubsub/docs/admin#resource_names">
* resource name rules</a>.
* Format is `projects/{project}/snapshots/{snap}`.
* User-provided name for this snapshot. If the name is not provided in the
* request, the server will assign a random name for this snapshot on the same
* project as the subscription. Note that for REST API requests, you must
* specify a name. See the <a
* href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource
* name rules</a>. Format is `projects/{project}/snapshots/{snap}`.
*

@@ -916,0 +926,0 @@ * @property {string} subscription

@@ -7,2 +7,10 @@ # Changelog

## [1.5.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v1.4.1...v1.5.0) (2020-02-03)
### Features
* added clientId to StreamingPullRequest ([b566ab3](https://www.github.com/googleapis/nodejs-pubsub/commit/b566ab3187efe08d19c29afc8a506a94ed2760b3))
* update defaults for batch settings also, and update which result codes will cause a retry ([#877](https://www.github.com/googleapis/nodejs-pubsub/issues/877)) ([32ae411](https://www.github.com/googleapis/nodejs-pubsub/commit/32ae4114fb7b42722a6c5100e9d494e470a5cae2))
### [1.4.1](https://www.github.com/googleapis/nodejs-pubsub/compare/v1.4.0...v1.4.1) (2020-01-28)

@@ -9,0 +17,0 @@

{
"name": "@google-cloud/pubsub",
"description": "Cloud Pub/Sub Client Library for Node.js",
"version": "1.4.1",
"version": "1.5.0",
"license": "Apache-2.0",

@@ -72,3 +72,3 @@ "author": "Google Inc.",

"@types/lodash.snakecase": "^4.1.6",
"@types/mocha": "^5.2.5",
"@types/mocha": "^7.0.0",
"@types/mv": "^2.1.0",

@@ -93,3 +93,3 @@ "@types/ncp": "^2.0.1",

"linkinator": "^1.5.0",
"mkdirp": "^0.5.1",
"mkdirp": "^1.0.0",
"mocha": "^7.0.0",

@@ -96,0 +96,0 @@ "mv": "^2.1.1",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display