Best way to develop pub/sub application - comparison of different examples

I am learning pub/sub and have seen at least 3 different ways to process pub/sub messages. Here they are:

1. https://cloud.google.com/pubsub/docs/samples/pubsub-subscribe-proto-messages

simplest. uses minimum dependencies.

2. https://cloud.google.com/run/docs/tutorials/pubsub#run_pubsub_server-java.

sets up a Spring MVC app and HTTP push subscription

3. https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/main/spring-cloud-gcp-samples/spring-cl... 

another Spring example using spring-cloud-gcp-starter-pubsub library

I am really confused which one of these to use for an application we need to develop. Our only constraint is that we want to run this application as a Cloud Run service. We don't have any requirement to use Spring and are neutral about it.

Can anyone guide which option to choose and why?

1 1 180
1 REPLY 1

Although I don't know the answer to the question you asked. But just loved what you shared, it will definitely gonna help me. Thanks a lot 😃