yoshidan / google-cloud-rust

Google Cloud Client Libraries for Rust.
MIT License
216 stars 81 forks source link

expose pubsub SubscriberClient for lease management #214

Closed pocesar closed 1 week ago

pocesar commented 7 months ago

https://cloud.google.com/pubsub/docs/lease-management

According to the docs, a ModifyAckDeadlineRequest can be sent to extend the default 600s max limit. It's not possible to extend the deadline as the SubscriberClient is pub(crate) and subc is also private.

Ideally this should be attached to the ReceivedMessage itself, so it can be extended while also being able to ack/nack. Another solution would to implement a fn client(&self) -> &SubscriberClient on Subscription

Using subscription.receive is currently impossible to implement on the codebase.

The use case is distributed worker that deals with 1 message at a time, but scales horizontally, but sometimes it can take much longer than 10 minutes to complete (~20 min), and using the streaming subscribe leads to a lot of unnecessary retries

pocesar commented 1 week ago

215 has been working fine in production for us, I guess this is done 😃