google-cloud-pubsub 2.15.2 → 2.15.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b35d78bd1388f589340f93c8e9b9634e06a82406bfeb7cc134f3f9efe9126316
4
- data.tar.gz: 74c1c0be39fcabaed038750157e891da276e13bb5017c57cbb62ccf542139421
3
+ metadata.gz: 917128878f11c491c30e0e8b68a56b5a6da8ce423d6da5afeed1b78adba8e175
4
+ data.tar.gz: ecf1a403989e28f5984056230629d649aa2e6f9c7d37fa713f62a52a3d464064
5
5
  SHA512:
6
- metadata.gz: 066db5f0cd5bdbd207cf8b928bab86dbb9438d7418ad0a596f07547738311ddb8ead880110e1464aeac7b6a90b44d9b54c36b86d3d873c623c866885c948e62f
7
- data.tar.gz: 51165f72d1a5813cae65c414915e907b9c15c8e6390ad9ba452b77a42cc6271d6d3b36fc62a97477bed12704d09d76993f0757c6cce8711c0f485eda0e5063f5
6
+ metadata.gz: 3a740219b3c2267802c22b2cc8b06be110006918e4ee4c48f06aeac368fb2a86c530cbd549dafb27e722a321fb5d2c87ca8b74921ef6a89c9bf7d084518fc3ae
7
+ data.tar.gz: ed5f36229f08a9395232f4770c78c3b9e5a0c6e77fdf0d324db83b636359e13b3e7eb16be71481de0feb4275f899da05c5fd78c3eb85a9d97c318c73c737affc
data/AUTHENTICATION.md CHANGED
@@ -125,15 +125,6 @@ To configure your system for this, simply:
125
125
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
126
126
  *should* only be used during development.
127
127
 
128
- [gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
129
- [dev-console]: https://console.cloud.google.com/project
130
-
131
- [enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
132
-
133
- [create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
134
- [create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
135
- [reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
136
-
137
128
  ## Creating a Service Account
138
129
 
139
130
  Google Cloud requires a **Project ID** and **Service Account Credentials** to
@@ -144,31 +135,22 @@ If you are not running this client within [Google Cloud Platform
144
135
  environments](#google-cloud-platform-environments), you need a Google
145
136
  Developers service account.
146
137
 
147
- 1. Visit the [Google Developers Console][dev-console].
138
+ 1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
148
139
  1. Create a new project or click on an existing project.
149
- 1. Activate the slide-out navigation tray and select **API Manager**. From
140
+ 1. Activate the menu in the upper left and select **APIs & Services**. From
150
141
  here, you will enable the APIs that your application requires.
151
142
 
152
- ![Enable the APIs that your application requires][enable-apis]
153
-
154
143
  *Note: You may need to enable billing in order to use these services.*
155
144
 
156
145
  1. Select **Credentials** from the side navigation.
157
146
 
158
- You should see a screen like one of the following.
159
-
160
- ![Create a new service account][create-new-service-account]
161
-
162
- ![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
163
-
164
- Find the "Add credentials" drop down and select "Service account" to be
165
- guided through downloading a new JSON key file.
166
-
167
- If you want to re-use an existing service account, you can easily generate a
168
- new key file. Just select the account you wish to re-use, and click "Generate
169
- new JSON key":
147
+ Find the "Create credentials" drop down near the top of the page, and select
148
+ "Service account" to be guided through downloading a new JSON key file.
170
149
 
171
- ![Re-use an existing service account][reuse-service-account]
150
+ If you want to re-use an existing service account, you can easily generate
151
+ a new key file. Just select the account you wish to re-use click the pencil
152
+ tool on the right side to edit the service account, select the **Keys** tab,
153
+ and then select **Add Key**.
172
154
 
173
155
  The key file you download will be used by this library to authenticate API
174
156
  requests and should be stored in a secure location.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Release History
2
2
 
3
+ ### 2.15.4 (2023-05-18)
4
+
5
+ #### Documentation
6
+
7
+ * Fixed broken links in authentication documentation ([#21619](https://github.com/googleapis/google-cloud-ruby/issues/21619))
8
+
9
+ ### 2.15.3 (2023-04-19)
10
+
11
+ #### Bug Fixes
12
+
13
+ * wait for successful receipt modack when exactly once delivery enabled ([#21431](https://github.com/googleapis/google-cloud-ruby/issues/21431))
14
+
3
15
  ### 2.15.2 (2023-03-19)
4
16
 
5
17
  #### Bug Fixes
@@ -248,6 +248,7 @@ module Google
248
248
  # Cannot syncronize the enumerator, causes deadlock
249
249
  response = enum.next
250
250
  new_exactly_once_delivery_enabled = response&.subscription_properties&.exactly_once_delivery_enabled
251
+ received_messages = response.received_messages
251
252
 
252
253
  # Use synchronize so changes happen atomically
253
254
  synchronize do
@@ -256,17 +257,21 @@ module Google
256
257
  @subscriber.exactly_once_delivery_enabled = @exactly_once_delivery_enabled
257
258
 
258
259
  # Create receipt of received messages reception
259
- @subscriber.buffer.modify_ack_deadline @subscriber.deadline, response.received_messages.map(&:ack_id)
260
-
261
- # Add received messages to inventory
262
- @inventory.add response.received_messages
260
+ if @exactly_once_delivery_enabled
261
+ create_receipt_modack_for_eos received_messages
262
+ else
263
+ @subscriber.buffer.modify_ack_deadline @subscriber.deadline, received_messages.map(&:ack_id)
264
+ # Add received messages to inventory
265
+ @inventory.add received_messages
266
+ end
263
267
  end
264
268
 
265
- response.received_messages.each do |rec_msg_grpc|
269
+ received_messages.each do |rec_msg_grpc|
266
270
  rec_msg = ReceivedMessage.from_grpc(rec_msg_grpc, self)
267
271
  # No need to synchronize the callback future
268
272
  register_callback rec_msg
269
- end
273
+ end if !@exactly_once_delivery_enabled # Exactly once delivery scenario is handled by callback
274
+
270
275
  synchronize { pause_streaming! }
271
276
  rescue StopIteration
272
277
  break
@@ -295,6 +300,19 @@ module Google
295
300
 
296
301
  # rubocop:enable all
297
302
 
303
+ def create_receipt_modack_for_eos received_messages
304
+ received_messages.each do |rec_msg_grpc|
305
+ callback = proc do |result|
306
+ if result.succeeded?
307
+ synchronize { @inventory.add rec_msg_grpc }
308
+ rec_msg = ReceivedMessage.from_grpc rec_msg_grpc, self
309
+ register_callback rec_msg
310
+ end
311
+ end
312
+ @subscriber.buffer.modify_ack_deadline @subscriber.deadline, [rec_msg_grpc.ack_id], callback
313
+ end
314
+ end
315
+
298
316
  # Updates min_duration_per_lease_extension to 60 when exactly_once_delivery_enabled
299
317
  # and reverts back to default 0 when disabled.
300
318
  # Skips if exactly_once_enabled is not modified.
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module PubSub
19
- VERSION = "2.15.2".freeze
19
+ VERSION = "2.15.4".freeze
20
20
  end
21
21
 
22
22
  Pubsub = PubSub unless const_defined? :Pubsub
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.15.2
4
+ version: 2.15.4
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: 2023-03-20 00:00:00.000000000 Z
12
+ date: 2023-05-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: concurrent-ruby