Google Cloud Pub/Sub is a fully-managed real-time messaging service that allows you to send and receive messages between independent applications. These sample Java applications demonstrate how to access the Pub/Sub API using the Google Cloud Client Library for Java.
Install Maven.
Build your project with:
mvn clean package -DskipTests
To run the tests for this sample, first set the GOOGLE_CLOUD_PROJECT
environment variable.
export GOOGLE_CLOUD_PROJECT=my-project
Then run the tests with Maven.
mvn clean verify
mvn exec:java -Dexec.mainClass=com.example.pubsub.QuickstartSample