google-cloud-pubsub

Does subscription ack setting in GCP Pub Sub are automatically overriden by the client library for pull subscriptions?


We are using GCP Pub Sub client library (com.google.cloud.pubsub.v1) to process the messages from a subscription. The pull subscription has the default ACK deadline of 10 seconds.

Looking for some clarification regarding the GCP documentation stating

The subscriber handles the ack management, by automatically extending the ack deadline while the message is being processed, to then issue the ack or nack of such message when the processing is done.

Does this mean that the client lib will automatically extend the ack deadline and override the deadline set in the subscription in the GCP console when it has received the message and still processing it?

Edit: Rereading the question, I realized I might have made some sections unclear.

Wanted to check if the deadline is extended for each message that has not been acknowledged within the deadline or they have to be in a specific condition what conditions.

For e.g.

  1. GCP subscription has default ack deadline i.e. 10sec
  2. The message is read from the subscription using the client library and is being processed but the processing takes say 30 seconds.

So does the client library send the request to extend the ack deadline for all messages where processing is taking more than 10 seconds or it has to be a specific condition?


Solution

  • Does this mean that the client lib will automatically extend the ack deadline and override the deadline set in the subscription in the GCP console when it has received the message and still processing it?

    It doesn't change the deadline within the subscription itself - it just sends a request saying "Hey, I'm still processing this specific message, there's no need to resend it".

    The intention is that basically the client libraries do a lot of the tricky message management so that you can focus on the business logic you need to write.