This is a simple demo using GCP Serverless Function that publisher a message to a PubSub Topic
Set the environment variable with your project ID
set GOOGLE_APPLICATION_CREDENTIALS=service-account.json
set GOOGLE_CLOUD_PROJECT=pacific-diode-316600
set PUBSUB_TOPIC_NAME=projects/pacific-diode-316600/topics/mytopic
mvn function:run
gcloud functions deploy PublisherFunction --entry-point me.brunocrt.gcp.functions.PublisherFunction --runtime java11 --trigger-http --memory 128MB --allow-unauthenticated
gcloud functions describe PublisherFunction
gcloud functions logs read PublisherFunction