I have a very simple pub/sub application written in Spring Boot that pulls messages from a subscription and logs them. I followed this tutorial. I have created a docker image from this program and can successfully run it locally and it picks up pub/sub messages that I create. When I push this image to Google Cloud Run it runs the docker image successfully however it doesn't pick up any pub/sub messages.
The strange part is that if I create a docker image from the program that doesn't have a HTTP server for Cloud Run's healthchecker the application actually picks up pub/sub messages in Cloud Run, however after 4 minutes without a health check Cloud Run shuts down the service. For a healthcheck service I use spring-boot-starter-web which runs an Apache Tomcat server on port 8080. I can run this program locally with the healthcheck service and it picks up pub/sub messages.
It seems that the HTTP server is stopping the pub/sub messages from getting pulled in Cloud Run. I'm not sure why that occurs because a pull subscription in pub/sub simply sends HTTP requests and awaits a response.