@google-cloud/pubsub 3.3.0 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +3 -2
- package/build/protos/google/pubsub/v1/pubsub.proto +46 -34
- package/build/protos/google/pubsub/v1/schema.proto +6 -6
- package/build/protos/protos.d.ts +1671 -166
- package/build/protos/protos.js +4158 -227
- package/build/protos/protos.json +319 -10
- package/build/src/publisher/index.js +2 -2
- package/build/src/publisher/index.js.map +1 -1
- package/build/src/publisher/message-queues.d.ts +29 -1
- package/build/src/publisher/message-queues.js +32 -2
- package/build/src/publisher/message-queues.js.map +1 -1
- package/build/src/v1/publisher_client.d.ts +20 -20
- package/build/src/v1/publisher_client.js +12 -12
- package/build/src/v1/schema_service_client.d.ts +29 -30
- package/build/src/v1/schema_service_client.js +14 -14
- package/build/src/v1/schema_service_client.js.map +1 -1
- package/build/src/v1/subscriber_client.d.ts +52 -58
- package/build/src/v1/subscriber_client.js +16 -16
- package/build/src/v1/subscriber_client.js.map +1 -1
- package/build/src/v1/subscriber_client_config.json +7 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,20 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/@google-cloud/pubsub?activeTab=versions
|
|
6
6
|
|
|
7
|
+
## [3.4.0](https://github.com/googleapis/nodejs-pubsub/compare/v3.3.0...v3.4.0) (2023-03-06)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* Add google.api.method.signature to update methods ([1e28405](https://github.com/googleapis/nodejs-pubsub/commit/1e2840529a8451c94d5d845062da84729b7843db))
|
|
13
|
+
* Add temporary_failed_ack_ids to ModifyAckDeadlineConfirmation ([1e28405](https://github.com/googleapis/nodejs-pubsub/commit/1e2840529a8451c94d5d845062da84729b7843db))
|
|
14
|
+
* Make INTERNAL a retryable error for Pull ([#1681](https://github.com/googleapis/nodejs-pubsub/issues/1681)) ([1e28405](https://github.com/googleapis/nodejs-pubsub/commit/1e2840529a8451c94d5d845062da84729b7843db))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* Don't do multiple drains per publish() in message queues unless requested ([#1691](https://github.com/googleapis/nodejs-pubsub/issues/1691)) ([d9b3a63](https://github.com/googleapis/nodejs-pubsub/commit/d9b3a63ddbfec0581a0e05fdbfcf9e9326b3dcf9))
|
|
20
|
+
|
|
7
21
|
## [3.3.0](https://github.com/googleapis/nodejs-pubsub/compare/v3.2.1...v3.3.0) (2023-01-23)
|
|
8
22
|
|
|
9
23
|
|
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
[Cloud Pub/Sub](https://cloud.google.com/pubsub/docs) is a fully-managed real-time messaging service that allows
|
|
14
14
|
you to send and receive messages between independent applications.
|
|
15
15
|
|
|
16
|
-
This document contains links to an [API reference](https://
|
|
16
|
+
This document contains links to an [API reference](https://cloud.google.com/nodejs/docs/reference/pubsub/latest/overview), samples,
|
|
17
17
|
and other resources useful to developing Node.js applications.
|
|
18
18
|
For additional help developing Pub/Sub applications, in Node.js and other languages, see our
|
|
19
19
|
[Pub/Sub quickstart](https://cloud.google.com/pubsub/docs/quickstart-client-libraries),
|
|
@@ -96,7 +96,7 @@ async function quickstart(
|
|
|
96
96
|
});
|
|
97
97
|
|
|
98
98
|
// Send a message to the topic
|
|
99
|
-
topic.
|
|
99
|
+
topic.publishMessage({data: Buffer.from('Test message!')});
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
```
|
|
@@ -174,6 +174,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-pubsub/tree
|
|
|
174
174
|
| Test Subscription Permissions | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/testSubscriptionPermissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/testSubscriptionPermissions.js,samples/README.md) |
|
|
175
175
|
| Test Topic Permissions | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/testTopicPermissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/testTopicPermissions.js,samples/README.md) |
|
|
176
176
|
| Update Dead Letter Policy | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/updateDeadLetterPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/updateDeadLetterPolicy.js,samples/README.md) |
|
|
177
|
+
| Validate a schema definition | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/validateSchema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/validateSchema.js,samples/README.md) |
|
|
177
178
|
|
|
178
179
|
|
|
179
180
|
|
|
@@ -60,6 +60,7 @@ service Publisher {
|
|
|
60
60
|
patch: "/v1/{topic.name=projects/*/topics/*}"
|
|
61
61
|
body: "*"
|
|
62
62
|
};
|
|
63
|
+
option (google.api.method_signature) = "topic,update_mask";
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
// Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic
|
|
@@ -214,7 +215,7 @@ message Topic {
|
|
|
214
215
|
// timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time)
|
|
215
216
|
// that is up to `message_retention_duration` in the past. If this field is
|
|
216
217
|
// not set, message retention is controlled by settings on individual
|
|
217
|
-
// subscriptions. Cannot be more than
|
|
218
|
+
// subscriptions. Cannot be more than 31 days or less than 10 minutes.
|
|
218
219
|
google.protobuf.Duration message_retention_duration = 8;
|
|
219
220
|
}
|
|
220
221
|
|
|
@@ -253,6 +254,8 @@ message PubsubMessage {
|
|
|
253
254
|
// delivered to subscribers in the order in which they are received by the
|
|
254
255
|
// Pub/Sub system. All `PubsubMessage`s published in a given `PublishRequest`
|
|
255
256
|
// must specify the same `ordering_key` value.
|
|
257
|
+
// For more information, see [ordering
|
|
258
|
+
// messages](https://cloud.google.com/pubsub/docs/ordering).
|
|
256
259
|
string ordering_key = 5;
|
|
257
260
|
}
|
|
258
261
|
|
|
@@ -461,6 +464,7 @@ service Subscriber {
|
|
|
461
464
|
patch: "/v1/{subscription.name=projects/*/subscriptions/*}"
|
|
462
465
|
body: "*"
|
|
463
466
|
};
|
|
467
|
+
option (google.api.method_signature) = "subscription,update_mask";
|
|
464
468
|
}
|
|
465
469
|
|
|
466
470
|
// Lists matching subscriptions.
|
|
@@ -515,9 +519,7 @@ service Subscriber {
|
|
|
515
519
|
option (google.api.method_signature) = "subscription,ack_ids";
|
|
516
520
|
}
|
|
517
521
|
|
|
518
|
-
// Pulls messages from the server.
|
|
519
|
-
// there are too many concurrent pull requests pending for the given
|
|
520
|
-
// subscription.
|
|
522
|
+
// Pulls messages from the server.
|
|
521
523
|
rpc Pull(PullRequest) returns (PullResponse) {
|
|
522
524
|
option (google.api.http) = {
|
|
523
525
|
post: "/v1/{subscription=projects/*/subscriptions/*}:pull"
|
|
@@ -554,10 +556,10 @@ service Subscriber {
|
|
|
554
556
|
}
|
|
555
557
|
|
|
556
558
|
// Gets the configuration details of a snapshot. Snapshots are used in
|
|
557
|
-
//
|
|
558
|
-
//
|
|
559
|
-
//
|
|
560
|
-
//
|
|
559
|
+
// [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations,
|
|
560
|
+
// which allow you to manage message acknowledgments in bulk. That is, you can
|
|
561
|
+
// set the acknowledgment state of messages in an existing subscription to the
|
|
562
|
+
// state captured by a snapshot.
|
|
561
563
|
rpc GetSnapshot(GetSnapshotRequest) returns (Snapshot) {
|
|
562
564
|
option (google.api.http) = {
|
|
563
565
|
get: "/v1/{snapshot=projects/*/snapshots/*}"
|
|
@@ -602,16 +604,16 @@ service Subscriber {
|
|
|
602
604
|
}
|
|
603
605
|
|
|
604
606
|
// Updates an existing snapshot. Snapshots are used in
|
|
605
|
-
//
|
|
606
|
-
//
|
|
607
|
-
//
|
|
608
|
-
//
|
|
609
|
-
// captured by a snapshot.
|
|
607
|
+
// [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations,
|
|
608
|
+
// which allow you to manage message acknowledgments in bulk. That is, you can
|
|
609
|
+
// set the acknowledgment state of messages in an existing subscription to the
|
|
610
|
+
// state captured by a snapshot.
|
|
610
611
|
rpc UpdateSnapshot(UpdateSnapshotRequest) returns (Snapshot) {
|
|
611
612
|
option (google.api.http) = {
|
|
612
613
|
patch: "/v1/{snapshot.name=projects/*/snapshots/*}"
|
|
613
614
|
body: "*"
|
|
614
615
|
};
|
|
616
|
+
option (google.api.method_signature) = "snapshot,update_mask";
|
|
615
617
|
}
|
|
616
618
|
|
|
617
619
|
// Removes an existing snapshot. Snapshots are used in [Seek]
|
|
@@ -645,7 +647,9 @@ service Subscriber {
|
|
|
645
647
|
}
|
|
646
648
|
}
|
|
647
649
|
|
|
648
|
-
// A subscription resource.
|
|
650
|
+
// A subscription resource. If none of `push_config` or `bigquery_config` is
|
|
651
|
+
// set, then the subscriber will pull and ack messages using API methods. At
|
|
652
|
+
// most one of these fields may be set.
|
|
649
653
|
message Subscription {
|
|
650
654
|
option (google.api.resource) = {
|
|
651
655
|
type: "pubsub.googleapis.com/Subscription"
|
|
@@ -683,21 +687,17 @@ message Subscription {
|
|
|
683
687
|
];
|
|
684
688
|
|
|
685
689
|
// If push delivery is used with this subscription, this field is
|
|
686
|
-
// used to configure it.
|
|
687
|
-
// but not both. If both are empty, then the subscriber will pull and ack
|
|
688
|
-
// messages using API methods.
|
|
690
|
+
// used to configure it.
|
|
689
691
|
PushConfig push_config = 4;
|
|
690
692
|
|
|
691
693
|
// If delivery to BigQuery is used with this subscription, this field is
|
|
692
|
-
// used to configure it.
|
|
693
|
-
// but not both. If both are empty, then the subscriber will pull and ack
|
|
694
|
-
// messages using API methods.
|
|
694
|
+
// used to configure it.
|
|
695
695
|
BigQueryConfig bigquery_config = 18;
|
|
696
696
|
|
|
697
697
|
// The approximate amount of time (on a best-effort basis) Pub/Sub waits for
|
|
698
698
|
// the subscriber to acknowledge receipt before resending the message. In the
|
|
699
699
|
// interval after the message is delivered and before it is acknowledged, it
|
|
700
|
-
// is considered to be
|
|
700
|
+
// is considered to be _outstanding_. During that time period, the
|
|
701
701
|
// message will not be redelivered (on a best-effort basis).
|
|
702
702
|
//
|
|
703
703
|
// For pull subscriptions, this value is used as the initial value for the ack
|
|
@@ -732,8 +732,8 @@ message Subscription {
|
|
|
732
732
|
// minutes.
|
|
733
733
|
google.protobuf.Duration message_retention_duration = 8;
|
|
734
734
|
|
|
735
|
-
// See
|
|
736
|
-
//
|
|
735
|
+
// See [Creating and managing
|
|
736
|
+
// labels](https://cloud.google.com/pubsub/docs/labels).
|
|
737
737
|
map<string, string> labels = 9;
|
|
738
738
|
|
|
739
739
|
// If true, messages published with the same `ordering_key` in `PubsubMessage`
|
|
@@ -747,7 +747,8 @@ message Subscription {
|
|
|
747
747
|
// successfully consuming messages from the subscription or is issuing
|
|
748
748
|
// operations on the subscription. If `expiration_policy` is not set, a
|
|
749
749
|
// *default policy* with `ttl` of 31 days will be used. The minimum allowed
|
|
750
|
-
// value for `expiration_policy.ttl` is 1 day.
|
|
750
|
+
// value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
|
|
751
|
+
// but `expiration_policy.ttl` is not set, the subscription never expires.
|
|
751
752
|
ExpirationPolicy expiration_policy = 11;
|
|
752
753
|
|
|
753
754
|
// An expression written in the Pub/Sub [filter
|
|
@@ -922,7 +923,7 @@ message PushConfig {
|
|
|
922
923
|
// * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
|
|
923
924
|
//
|
|
924
925
|
// For example:
|
|
925
|
-
//
|
|
926
|
+
// `attributes { "x-goog-version": "v1" }`
|
|
926
927
|
map<string, string> attributes = 2;
|
|
927
928
|
|
|
928
929
|
// An authentication method used by push endpoints to verify the source of
|
|
@@ -948,6 +949,11 @@ message BigQueryConfig {
|
|
|
948
949
|
ACTIVE = 1;
|
|
949
950
|
|
|
950
951
|
// Cannot write to the BigQuery table because of permission denied errors.
|
|
952
|
+
// This can happen if
|
|
953
|
+
// - Pub/Sub SA has not been granted the [appropriate BigQuery IAM
|
|
954
|
+
// permissions](https://cloud.google.com/pubsub/docs/create-subscription#assign_bigquery_service_account)
|
|
955
|
+
// - bigquery.googleapis.com API is not enabled for the project
|
|
956
|
+
// ([instructions](https://cloud.google.com/service-usage/docs/enable-disable))
|
|
951
957
|
PERMISSION_DENIED = 2;
|
|
952
958
|
|
|
953
959
|
// Cannot write to the BigQuery table because it does not exist.
|
|
@@ -958,7 +964,7 @@ message BigQueryConfig {
|
|
|
958
964
|
}
|
|
959
965
|
|
|
960
966
|
// The name of the table to which to write data, of the form
|
|
961
|
-
// {projectId}
|
|
967
|
+
// {projectId}.{datasetId}.{tableId}
|
|
962
968
|
string table = 1;
|
|
963
969
|
|
|
964
970
|
// When true, use the topic's schema as the columns to write to in BigQuery,
|
|
@@ -1127,7 +1133,8 @@ message PullRequest {
|
|
|
1127
1133
|
// Response for the `Pull` method.
|
|
1128
1134
|
message PullResponse {
|
|
1129
1135
|
// Received Pub/Sub messages. The list will be empty if there are no more
|
|
1130
|
-
// messages available in the backlog
|
|
1136
|
+
// messages available in the backlog, or if no messages could be returned
|
|
1137
|
+
// before the request timeout. For JSON, the response can be entirely
|
|
1131
1138
|
// empty. The Pub/Sub system may return fewer than the `maxMessages` requested
|
|
1132
1139
|
// even if there are more messages available in the backlog.
|
|
1133
1140
|
repeated ReceivedMessage received_messages = 1;
|
|
@@ -1270,6 +1277,9 @@ message StreamingPullResponse {
|
|
|
1270
1277
|
|
|
1271
1278
|
// List of acknowledgement IDs that were out of order.
|
|
1272
1279
|
repeated string unordered_ack_ids = 3;
|
|
1280
|
+
|
|
1281
|
+
// List of acknowledgement IDs that failed processing with temporary issues.
|
|
1282
|
+
repeated string temporary_failed_ack_ids = 4;
|
|
1273
1283
|
}
|
|
1274
1284
|
|
|
1275
1285
|
// Acknowledgement IDs sent in one or more previous requests to modify the
|
|
@@ -1281,12 +1291,16 @@ message StreamingPullResponse {
|
|
|
1281
1291
|
// List of acknowledgement IDs that were malformed or whose acknowledgement
|
|
1282
1292
|
// deadline has expired.
|
|
1283
1293
|
repeated string invalid_ack_ids = 2;
|
|
1294
|
+
|
|
1295
|
+
// List of acknowledgement IDs that failed processing with temporary issues.
|
|
1296
|
+
repeated string temporary_failed_ack_ids = 3;
|
|
1284
1297
|
}
|
|
1285
1298
|
|
|
1286
1299
|
// Subscription properties sent as part of the response.
|
|
1287
1300
|
message SubscriptionProperties {
|
|
1288
1301
|
// True iff exactly once delivery is enabled for this subscription.
|
|
1289
1302
|
bool exactly_once_delivery_enabled = 1;
|
|
1303
|
+
|
|
1290
1304
|
// True iff message ordering is enabled for this subscription.
|
|
1291
1305
|
bool message_ordering_enabled = 2;
|
|
1292
1306
|
}
|
|
@@ -1294,8 +1308,6 @@ message StreamingPullResponse {
|
|
|
1294
1308
|
// Received Pub/Sub messages. This will not be empty.
|
|
1295
1309
|
repeated ReceivedMessage received_messages = 1;
|
|
1296
1310
|
|
|
1297
|
-
reserved 2;
|
|
1298
|
-
|
|
1299
1311
|
// This field will only be set if `enable_exactly_once_delivery` is set to
|
|
1300
1312
|
// `true`.
|
|
1301
1313
|
AcknowledgeConfirmation acknowledge_confirmation = 5;
|
|
@@ -1313,9 +1325,9 @@ message CreateSnapshotRequest {
|
|
|
1313
1325
|
// Required. User-provided name for this snapshot. If the name is not provided
|
|
1314
1326
|
// in the request, the server will assign a random name for this snapshot on
|
|
1315
1327
|
// the same project as the subscription. Note that for REST API requests, you
|
|
1316
|
-
// must specify a name. See the
|
|
1317
|
-
//
|
|
1318
|
-
//
|
|
1328
|
+
// must specify a name. See the [resource name
|
|
1329
|
+
// rules](https://cloud.google.com/pubsub/docs/admin#resource_names). Format
|
|
1330
|
+
// is `projects/{project}/snapshots/{snap}`.
|
|
1319
1331
|
string name = 1 [
|
|
1320
1332
|
(google.api.field_behavior) = REQUIRED,
|
|
1321
1333
|
(google.api.resource_reference) = { type: "pubsub.googleapis.com/Snapshot" }
|
|
@@ -1337,8 +1349,8 @@ message CreateSnapshotRequest {
|
|
|
1337
1349
|
}
|
|
1338
1350
|
];
|
|
1339
1351
|
|
|
1340
|
-
// See
|
|
1341
|
-
//
|
|
1352
|
+
// See [Creating and managing
|
|
1353
|
+
// labels](https://cloud.google.com/pubsub/docs/labels).
|
|
1342
1354
|
map<string, string> labels = 3;
|
|
1343
1355
|
}
|
|
1344
1356
|
|
|
@@ -320,17 +320,17 @@ message DeleteSchemaRevisionRequest {
|
|
|
320
320
|
// Required. The name of the schema revision to be deleted, with a revision ID
|
|
321
321
|
// explicitly included.
|
|
322
322
|
//
|
|
323
|
-
// Example: projects/123/schemas/my-schema@c7cfa2a8
|
|
323
|
+
// Example: `projects/123/schemas/my-schema@c7cfa2a8`
|
|
324
324
|
string name = 1 [
|
|
325
325
|
(google.api.field_behavior) = REQUIRED,
|
|
326
326
|
(google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" }
|
|
327
327
|
];
|
|
328
328
|
|
|
329
|
-
//
|
|
330
|
-
//
|
|
331
|
-
//
|
|
332
|
-
|
|
333
|
-
|
|
329
|
+
// Optional. This field is deprecated and should not be used for specifying
|
|
330
|
+
// the revision ID. The revision ID should be specified via the `name`
|
|
331
|
+
// parameter.
|
|
332
|
+
string revision_id = 2
|
|
333
|
+
[deprecated = true, (google.api.field_behavior) = OPTIONAL];
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
// Request for the `DeleteSchema` method.
|