I’m curious how to approach an upgrade/reboot situation with an application consuming messages from a Google Pub/Sub.
For example I am particularly interested in developing a Golang application that is deployed in Kubernetes running multiple pods and consumes messages form a Google Pub/Sub. My concern is how can I ensure there are no messages missed (or processed twice) while a pod is being upgraded.
I understand the application would read the message from the subscription and then must acknowledge it has received it. I feel there may be a race condition between acknowledging the message and the pod shutting down to upgrade?
I know doing something similar is possible with a Dataflow job as you can stop a streaming job and signal it to drain the messages.
I assume there has to be someway to handle this gracefully, or is this really a situation where Dataflow is better suited?