google-cloud-pubsub 2.1.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/google/cloud/pubsub/subscription.rb +48 -10
- data/lib/google/cloud/pubsub/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9e9ee1f9fce40c034c43b3cf0e11b8e52dc5ebdc1c43f6077cfff620b812dd8
|
4
|
+
data.tar.gz: 6d29efc615b2bb5185a013c9dbb72811f130acdcee452343f53c7c6c1881ce3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0649f14787b5d7c59e6aa7cfcf7df321b63ac5faeda81c756c793cecf57a8ba31f9691c05816d7088cf40d8c1a80c36134a58b4658d381cfa05cb745687fcf1d'
|
7
|
+
data.tar.gz: a5a82376726956e5dee8dff1e17e64ddf54a2c8100830d15b1c3a17accd9fdc364b8d42051c29a86524a221c7cb14bbf300e3c0ce1f09fde678c2e8cf03fc1b8
|
data/CHANGELOG.md
CHANGED
@@ -377,8 +377,8 @@ module Google
|
|
377
377
|
# otherwise `nil`. Dead lettering is done on a best effort basis. The same message might be dead lettered
|
378
378
|
# multiple times.
|
379
379
|
#
|
380
|
-
# See also {#dead_letter_topic=}, {#dead_letter_max_delivery_attempts=}
|
381
|
-
# {#
|
380
|
+
# See also {#dead_letter_topic=}, {#dead_letter_max_delivery_attempts=}, {#dead_letter_max_delivery_attempts}
|
381
|
+
# and {#remove_dead_letter_policy}.
|
382
382
|
#
|
383
383
|
# Makes an API call to retrieve the topic name when called on a reference object. See {#reference?}.
|
384
384
|
#
|
@@ -409,7 +409,8 @@ module Google
|
|
409
409
|
# The operation will fail if the topic does not exist. Users should ensure that there is a subscription attached
|
410
410
|
# to this topic since messages published to a topic with no subscriptions are lost.
|
411
411
|
#
|
412
|
-
# See also {#dead_letter_topic}, {#dead_letter_max_delivery_attempts=}
|
412
|
+
# See also {#dead_letter_topic}, {#dead_letter_max_delivery_attempts=}, {#dead_letter_max_delivery_attempts}
|
413
|
+
# and {#remove_dead_letter_policy}.
|
413
414
|
#
|
414
415
|
# @param [Topic] new_dead_letter_topic The topic to which dead letter messages for the subscription should be
|
415
416
|
# published.
|
@@ -441,14 +442,15 @@ module Google
|
|
441
442
|
# acknowledgement deadline has been exceeded for the message). A NACK is any call to ModifyAckDeadline with a 0
|
442
443
|
# deadline. Note that client libraries may automatically extend ack_deadlines.
|
443
444
|
#
|
444
|
-
# This field will be honored on a best effort basis. If this parameter is 0
|
445
|
+
# This field will be honored on a best effort basis. If this parameter is `nil` or `0`, a default value of `5`
|
446
|
+
# is used.
|
445
447
|
#
|
446
|
-
# See also {#dead_letter_max_delivery_attempts=}, {#dead_letter_topic=}
|
448
|
+
# See also {#dead_letter_max_delivery_attempts=}, {#dead_letter_topic=}, {#dead_letter_topic}
|
449
|
+
# and {#remove_dead_letter_policy}.
|
447
450
|
#
|
448
451
|
# Makes an API call to retrieve the value when called on a reference object. See {#reference?}.
|
449
452
|
#
|
450
|
-
# @return [Integer, nil] A value between 5 and 100
|
451
|
-
# value is 0, a default value of 5 is used.
|
453
|
+
# @return [Integer, nil] A value between `5` and `100`, or `nil` if no dead letter policy is configured.
|
452
454
|
#
|
453
455
|
# @example
|
454
456
|
# require "google/cloud/pubsub"
|
@@ -475,10 +477,13 @@ module Google
|
|
475
477
|
#
|
476
478
|
# This field will be honored on a best effort basis. If this parameter is 0, a default value of 5 is used.
|
477
479
|
#
|
478
|
-
# The dead letter topic must
|
480
|
+
# The dead letter topic must be set first. See {#dead_letter_topic=}, {#dead_letter_topic} and
|
481
|
+
# {#remove_dead_letter_policy}.
|
482
|
+
#
|
483
|
+
# @param [Integer, nil] new_dead_letter_max_delivery_attempts A value between 5 and 100. If this parameter is
|
484
|
+
# `nil` or `0`, a default value of 5 is used.
|
479
485
|
#
|
480
|
-
# @
|
481
|
-
# default value of 5 is used.
|
486
|
+
# @raise [ArgumentError] if the dead letter topic has not been set. See {#dead_letter_topic=}.
|
482
487
|
#
|
483
488
|
# @example
|
484
489
|
# require "google/cloud/pubsub"
|
@@ -503,6 +508,39 @@ module Google
|
|
503
508
|
@resource_name = nil
|
504
509
|
end
|
505
510
|
|
511
|
+
##
|
512
|
+
# Removes an existing dead letter policy. A dead letter policy specifies the conditions for dead lettering
|
513
|
+
# messages in the subscription. If a dead letter policy is not set, dead lettering is disabled.
|
514
|
+
#
|
515
|
+
# See {#dead_letter_topic}, {#dead_letter_topic=}, {#dead_letter_max_delivery_attempts} and
|
516
|
+
# {#dead_letter_max_delivery_attempts=}.
|
517
|
+
#
|
518
|
+
# @return [Boolean] `true` if an existing dead letter policy was removed, `false` if no existing dead letter
|
519
|
+
# policy was present.
|
520
|
+
#
|
521
|
+
# @example
|
522
|
+
# require "google/cloud/pubsub"
|
523
|
+
#
|
524
|
+
# pubsub = Google::Cloud::PubSub.new
|
525
|
+
#
|
526
|
+
# sub = pubsub.subscription "my-topic-sub"
|
527
|
+
#
|
528
|
+
# sub.dead_letter_topic.name #=> "projects/my-project/topics/my-dead-letter-topic"
|
529
|
+
# sub.dead_letter_max_delivery_attempts #=> 10
|
530
|
+
#
|
531
|
+
# sub.remove_dead_letter_policy
|
532
|
+
#
|
533
|
+
# sub.dead_letter_topic #=> nil
|
534
|
+
# sub.dead_letter_max_delivery_attempts #=> nil
|
535
|
+
#
|
536
|
+
def remove_dead_letter_policy
|
537
|
+
ensure_grpc!
|
538
|
+
return false if @grpc.dead_letter_policy.nil?
|
539
|
+
update_grpc = Google::Cloud::PubSub::V1::Subscription.new name: name, dead_letter_policy: nil
|
540
|
+
@grpc = service.update_subscription update_grpc, :dead_letter_policy
|
541
|
+
true
|
542
|
+
end
|
543
|
+
|
506
544
|
##
|
507
545
|
# A policy that specifies how Cloud Pub/Sub retries message delivery for this subscription. If `nil`, the
|
508
546
|
# default retry policy is applied. This generally implies that messages will be retried as soon as possible
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-pubsub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Moore
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-11-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: concurrent-ruby
|