Open hemanthk269 opened 6 days ago
Cloud pubsub is by default at least once, so it can be redistributed even after ack unless the actively once delivery option is enabled. If you are concerned about the ack delay when exactly once delivery is enabled, you will need to devise a way of not processing the same message ID in your application.
we process pub sub messages in batches and call below iter method in a loop
iter method logic
We are seeing duplicate messages once in a while (getting duplicates in 0-2 iterations per 100 iterations) we are seeing duplicate in immediately next iteration not 2-4 iterations later (which is expected if ack is not done properly, ack_timeout is 20 sec and each iteration takes max 5 sec and in our testing it is only taking 2-3 sec)
also modified the code and check if the ack_ids are being nacked by library which will result in redelivery immediately, but that is also not the case, the messages for which we are receiving duplicates are not being nacked by library as well.
Unable to figure out the root cause of the duplicate messages.
We didn't enable exactly once delivery option for pub sub subscription as the through put is very less. (is this the root cause?)