0

I have a project built with Spring Cloud GCP, which makes use of a subscription that is configured with Exactly once delivery enabled on GCP Pub/Sub subscription settings, and with Ack deadline set to 5 minutes (also in the GCP console).

Using Spring, I also have access to configure subscriber settings using configuration options (for example: spring.cloud.gcp.pubsub.subscriber.max-ack-extension-period=1800).

My question is twofold:

  • Which of these configurations (GCP console vs Spring configuration parameters) take effect in case of conflict?
  • Can I actually have exactly-once delivery semantics with Spring Cloud GCP (given that the feature is marked as having limited support in the docs: https://cloud.google.com/pubsub/docs/exactly-once-delivery)?
Harsh Manvar
  • 27,020
  • 6
  • 48
  • 102
Silvia Pina
  • 323
  • 4
  • 21

1 Answers1

1

You can set the default ack timeout in your PubSub subscription and you can extend it (only for pull subscription) in your code, the max timeout being 10 minutes in any case.

There is no conflict: there is a default configuration, and a programmatic extension in case of congestion for example


The exactly-once delivery is also compliant with Spring Cloud GCP if you use the latest version, which use the latest Java client libraries. Spring Cloud GCP is only a wrapper that reuse the Spring programming framework but the underlying implementation still use the standard JAVA client libraries.

guillaume blaquiere
  • 66,369
  • 2
  • 47
  • 76
  • Where do you see 10 minutes as maximum timeout? GCP docs or Spring docs? – Silvia Pina Sep 26 '22 at 12:40
  • 1
    PubSub subscription max timeout is 10 minutes. If you have a default timeout of 5 minutes, your max extension deadline is 5 minutes because, in any case, you can go beyond the 10 minutes. https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/modifyAckDeadline – guillaume blaquiere Sep 26 '22 at 21:11
  • Thanks. The link you shared is for the REST API. Does Spring Cloud GCP use that, or does it go through a client? – Silvia Pina Sep 27 '22 at 08:25
  • Yes, it is. Don't know the exact implementation, but most of the time the client libraries are used, rarely the direct API calls. – guillaume blaquiere Sep 27 '22 at 09:56