Hi, I am noticing a lot of message re-deliveries in my pubsub consumer application, even though I have configured max ack deadline for subscription (600 seconds). I am using the async client api for pull-based subscriptions.
Here is an example of the redelivery from my logs:
If you look at the line with “DUPLICATE”, it is getting re-delivered within 6 seconds and also, through a different grpc thread (Gax-11 and Gax-13) . Why is the same message being delivered to 2 different threads?
I am using a subscription with 600 seconds for ackDeadline. So, the messages shouldn’t get re-delivered unless the ack didn’t reach the server ? is that something that can happen?
Fyi, in my application, I am trying to consume a batch of messages and ack them all when the processing is complete. I verified that my code is invoking ACK on all the processed messages. I am using flow control to manage the batch of consumed messages. But it doesn't seem to improve the duplicates situation.
Any help would be appreciated!
Thanks!
Navina
TLDR; Usage pattern of my application:
```Consumer implementation:
start():
Create a subscription
seek to a known snapshot (if any); if not found, create a new snapshot
Start one subscriber (message receiver adds the received messages to a shared queue)
fetch():
ACK previous batch of messages (if any)
Poll a batch of messages from shared queue and return
checkpoint():
ACK any processed messages
Create a new snapshot
close():
ACK any previous batch of messages that are pending ack
Take a snapshot
stop subscriber
delete subscription
Application:
start()
While (some critteria is reached): {
fetch()
}
checkpoint()
close()
```