I'm running a Java 8 servlet based application as a Google Cloud Pub/Sub push endpoint. The ack deadline is 600 seconds. The server is embedded Jetty 9.4.
Say I have a message M
that I know to be published to the topic with my push subscription.
My endpoint takes a long time to handle the message before acking it. It executes a script (as a subprocess using Java ProcessBuilder
class) that sometimes can run for a long time. Let's say I receive the message M
at 8:00:00 AM. My script starts running, and the request sent by the push subscription is still active. Then, at 8:00:30 AM I receive that same message M
, even though I have not returned a 200
or 500
response to a previous request.
When I test my app locally, I am able to post a 200
response after 40 or more seconds.
How can I fix this? I know I probably should be using a pull subscription, but the behavior that I observe is not documented, or at least I couldn't find it.