hanami-events-cloud_pubsub 3.2.0 → 3.2.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cedb970c9a8160f1d3b1e1c41dd87b5bfb8d35cb29872694af944110f681b7fc
|
4
|
+
data.tar.gz: 277273b17749ba058a545f1caadc3819688964c9fccaaf34a1774b7445f4b86f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f76c43c7a07b590e9c9f6b7e8839d5ab37266c4b353099bfc1a872308db646c5a4421a3185c13e20d55a80e7a67242fac975824b29de4f0afee51a6af1e2d6f
|
7
|
+
data.tar.gz: af41acad939eabcf399b7f7936b54a99f173a00da497991929de64ebb00dbd3b0da8f48f917dfc1f8b818227671744631b6d6e260c4706c4a901086d479d1f1f
|
@@ -42,7 +42,7 @@ module Hanami
|
|
42
42
|
|
43
43
|
def register
|
44
44
|
subscription = subscription_for(subscriber_id)
|
45
|
-
|
45
|
+
apply_subscription_options(subscription)
|
46
46
|
listener = subscription.listen(**subscriber_options) { |m| handle_message(m) }
|
47
47
|
logger.debug("Registered listener for #{subscriber_id} with: #{subscriber_options}")
|
48
48
|
|
@@ -135,21 +135,38 @@ module Hanami
|
|
135
135
|
}
|
136
136
|
end
|
137
137
|
|
138
|
-
def
|
139
|
-
|
138
|
+
def apply_subscription_options(sub)
|
139
|
+
apply_deadline_options(sub)
|
140
|
+
apply_retry_options(sub)
|
141
|
+
apply_dead_letter_options(sub)
|
142
|
+
rescue StandardError => e
|
143
|
+
run_error_handlers(e, nil)
|
144
|
+
end
|
145
|
+
|
146
|
+
def apply_deadline_options(sub)
|
147
|
+
sub.deadline = subscriber_options[:deadline] if sub.deadline != subscriber_options[:deadline]
|
148
|
+
rescue StandardError => e
|
149
|
+
run_error_handlers(e, nil)
|
150
|
+
end
|
151
|
+
|
152
|
+
def apply_dead_letter_options(sub)
|
140
153
|
attempts = CloudPubsub.config.auto_retry.max_attempts
|
141
154
|
|
142
|
-
sub.retry_policy = retry_policy if sub.retry_policy&.to_grpc != retry_policy&.to_grpc
|
143
155
|
sub.dead_letter_topic = dead_letter_topic if sub.dead_letter_topic&.name != dead_letter_topic&.name
|
144
156
|
sub.dead_letter_max_delivery_attempts = attempts if sub.dead_letter_topic&.name != dead_letter_topic&.name
|
157
|
+
rescue StandardError => e
|
158
|
+
run_error_handlers(e, nil)
|
159
|
+
end
|
145
160
|
|
146
|
-
|
161
|
+
def apply_retry_options(sub)
|
162
|
+
retry_policy = build_retry_policy
|
163
|
+
sub.retry_policy = retry_policy if sub.retry_policy&.to_grpc != retry_policy&.to_grpc
|
147
164
|
rescue StandardError => e
|
148
165
|
run_error_handlers(e, nil)
|
149
166
|
end
|
150
167
|
|
151
168
|
def build_retry_policy
|
152
|
-
return unless CloudPubsub.config.auto_retry.enabled
|
169
|
+
return unless Hanami::Events::CloudPubsub.config.auto_retry.enabled
|
153
170
|
|
154
171
|
Google::Cloud::PubSub::RetryPolicy.new(
|
155
172
|
minimum_backoff: CloudPubsub.config.auto_retry.minimum_backoff,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hanami-events-cloud_pubsub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Ker-Seymer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-configurable
|