{"id":18533106,"url":"https://github.com/googleapis/java-pubsub","last_synced_at":"2025-12-12T20:28:37.683Z","repository":{"id":37590079,"uuid":"203461480","full_name":"googleapis/java-pubsub","owner":"googleapis","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-08T16:44:58.000Z","size":8557,"stargazers_count":137,"open_issues_count":33,"forks_count":97,"subscribers_count":57,"default_branch":"main","last_synced_at":"2025-05-08T17:44:41.385Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/googleapis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-08-20T22:07:36.000Z","updated_at":"2025-05-08T16:42:35.000Z","dependencies_parsed_at":"2022-07-12T16:32:36.825Z","dependency_job_id":"265fdda0-c99d-406e-9c51-5f72cd9b2cf0","html_url":"https://github.com/googleapis/java-pubsub","commit_stats":null,"previous_names":[],"tags_count":272,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fjava-pubsub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fjava-pubsub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fjava-pubsub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fjava-pubsub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/googleapis","download_url":"https://codeload.github.com/googleapis/java-pubsub/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254110374,"owners_count":22016391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T19:09:24.817Z","updated_at":"2025-12-12T20:28:37.673Z","avatar_url":"https://github.com/googleapis.png","language":"Java","funding_links":[],"categories":["进程间通信"],"sub_categories":[],"readme":"# Google Cloud Pub/Sub Client for Java\n\nJava idiomatic client for [Cloud Pub/Sub][product-docs].\n\n[![Maven][maven-version-image]][maven-version-link]\n![Stability][stability-image]\n\n- [Product Documentation][product-docs]\n- [Client Library Documentation][javadocs]\n\n\n## Quickstart\n\nIf you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:\n\n```xml\n\u003cdependencyManagement\u003e\n  \u003cdependencies\u003e\n    \u003cdependency\u003e\n      \u003cgroupId\u003ecom.google.cloud\u003c/groupId\u003e\n      \u003cartifactId\u003elibraries-bom\u003c/artifactId\u003e\n      \u003cversion\u003e26.72.0\u003c/version\u003e\n      \u003ctype\u003epom\u003c/type\u003e\n      \u003cscope\u003eimport\u003c/scope\u003e\n    \u003c/dependency\u003e\n  \u003c/dependencies\u003e\n\u003c/dependencyManagement\u003e\n\n\u003cdependencies\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.google.cloud\u003c/groupId\u003e\n    \u003cartifactId\u003egoogle-cloud-pubsub\u003c/artifactId\u003e\n  \u003c/dependency\u003e\n\n\u003c/dependencies\u003e\n\n```\n\nIf you are using Maven without the BOM, add this to your dependencies:\n\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.google.cloud\u003c/groupId\u003e\n  \u003cartifactId\u003egoogle-cloud-pubsub\u003c/artifactId\u003e\n  \u003cversion\u003e1.143.1\u003c/version\u003e\n\u003c/dependency\u003e\n\n```\n\nIf you are using Gradle 5.x or later, add this to your dependencies:\n\n```Groovy\nimplementation platform('com.google.cloud:libraries-bom:26.72.0')\n\nimplementation 'com.google.cloud:google-cloud-pubsub'\n```\nIf you are using Gradle without BOM, add this to your dependencies:\n\n```Groovy\nimplementation 'com.google.cloud:google-cloud-pubsub:1.144.0'\n```\n\nIf you are using SBT, add this to your dependencies:\n\n```Scala\nlibraryDependencies += \"com.google.cloud\" % \"google-cloud-pubsub\" % \"1.144.0\"\n```\n\n## Authentication\n\nSee the [Authentication][authentication] section in the base directory's README.\n\n## Authorization\n\nThe client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired Cloud Pub/Sub APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Cloud Pub/Sub API calls.\n\n## Getting Started\n\n### Prerequisites\n\nYou will need a [Google Cloud Platform Console][developer-console] project with the Cloud Pub/Sub [API enabled][enable-api].\nYou will need to [enable billing][enable-billing] to use Google Cloud Pub/Sub.\n[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by\n[installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line:\n`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`.\n\n### Installation and setup\n\nYou'll need to obtain the `google-cloud-pubsub` library.  See the [Quickstart](#quickstart) section\nto add `google-cloud-pubsub` as a dependency in your code.\n\n## About Cloud Pub/Sub\n\n\n[Cloud Pub/Sub][product-docs] is designed to provide reliable, many-to-many, asynchronous messaging between applications. Publisher applications can send messages to a topic and other applications can subscribe to that topic to receive the messages. By decoupling senders and receivers, Google Cloud Pub/Sub allows developers to communicate between independently written applications.\n\nSee the [Cloud Pub/Sub client library docs][javadocs] to learn how to\nuse this Cloud Pub/Sub Client Library.\n\n\n#### Creating a topic\n\nWith Pub/Sub you can create topics. A topic is a named resource to which messages are sent by\npublishers. Add the following imports at the top of your file:\n\n```java\nimport com.google.cloud.pubsub.v1.TopicAdminClient;\nimport com.google.pubsub.v1.TopicName;\n```\nThen, to create the topic, use the following code:\n\n```java\nTopicName topic = TopicName.of(\"test-project\", \"test-topic\");\ntry (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {\n  topicAdminClient.createTopic(topic);\n}\n```\n\n#### Publishing messages\n\nWith Pub/Sub you can publish messages to a topic. Add the following import at the top of your file:\n\n```java\nimport com.google.api.core.ApiFuture;\nimport com.google.api.core.ApiFutureCallback;\nimport com.google.api.core.ApiFutures;\nimport com.google.cloud.pubsub.v1.Publisher;\nimport com.google.common.util.concurrent.MoreExecutors;\nimport com.google.protobuf.ByteString;\nimport com.google.pubsub.v1.PubsubMessage;\n```\nThen, to publish messages asynchronously, use the following code:\n\n```java\nPublisher publisher = null;\ntry {\n  publisher = Publisher.newBuilder(topic).build();\n  ByteString data = ByteString.copyFromUtf8(\"my-message\");\n  PubsubMessage pubsubMessage = PubsubMessage.newBuilder().setData(data).build();\n  ApiFuture\u003cString\u003e messageIdFuture = publisher.publish(pubsubMessage);\n  ApiFutures.addCallback(messageIdFuture, new ApiFutureCallback\u003cString\u003e() {\n    public void onSuccess(String messageId) {\n      System.out.println(\"published with message id: \" + messageId);\n    }\n\n    public void onFailure(Throwable t) {\n      System.out.println(\"failed to publish: \" + t);\n    }\n  }, MoreExecutors.directExecutor());\n  //...\n} finally {\n  if (publisher != null) {\n    publisher.shutdown();\n    publisher.awaitTermination(1, TimeUnit.MINUTES);\n  }\n}\n```\n\n#### Creating a subscription\n\nWith Pub/Sub you can create subscriptions. A subscription represents the stream of messages from a\nsingle, specific topic. Add the following imports at the top of your file:\n\n```java\nimport com.google.cloud.pubsub.v1.SubscriptionAdminClient;\nimport com.google.pubsub.v1.PushConfig;\nimport com.google.pubsub.v1.SubscriptionName;\nimport com.google.pubsub.v1.TopicName;\n```\nThen, to create the subscription, use the following code:\n\n```java\nTopicName topic = TopicName.of(\"test-project\", \"test-topic\");\nSubscriptionName subscription = SubscriptionName.of(\"test-project\", \"test-subscription\");\n\ntry (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {\n  subscriptionAdminClient.createSubscription(subscription, topic, PushConfig.getDefaultInstance(), 0);\n}\n```\n\n#### Pulling messages\n\nWith Pub/Sub you can pull messages from a subscription. Add the following imports at the top of your\nfile:\n\n```java\nimport com.google.cloud.pubsub.v1.AckReplyConsumer;\nimport com.google.cloud.pubsub.v1.MessageReceiver;\nimport com.google.cloud.pubsub.v1.Subscriber;\nimport com.google.common.util.concurrent.MoreExecutors;\nimport com.google.pubsub.v1.PubsubMessage;\nimport com.google.pubsub.v1.SubscriptionName;\nimport com.google.pubsub.v1.TopicName;\n```\nThen, to pull messages asynchronously, use the following code:\n\n```java\nSubscriptionName subscription = SubscriptionName.of(\"test-project\", \"test-subscription\");\n\nMessageReceiver receiver =\n  new MessageReceiver() {\n    @Override\n    public void receiveMessage(PubsubMessage message, AckReplyConsumer consumer) {\n      System.out.println(\"got message: \" + message.getData().toStringUtf8());\n      consumer.ack();\n    }\n  };\n\nSubscriber subscriber = null;\ntry {\n  subscriber = Subscriber.newBuilder(subscription.toString(), receiver).build();\n  subscriber.addListener(\n    new Subscriber.Listener() {\n      @Override\n      public void failed(Subscriber.State from, Throwable failure) {\n        // Handle failure. This is called when the Subscriber encountered a fatal error and is shutting down.\n        System.err.println(failure);\n      }\n    },\n    MoreExecutors.directExecutor());\n  subscriber.startAsync().awaitRunning();\n  //...\n} finally {\n  if (subscriber != null) {\n    subscriber.stopAsync();\n  }\n}\n```\n#### Complete source code\n\nIn [CreateTopicAndPublishMessages.java](https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/CreateTopicAndPublishMessages.java) and [CreateSubscriptionAndConsumeMessages.java](https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/CreateSubscriptionAndConsumeMessages.java) we put together all the code shown above into two programs. The programs assume that you are running on Compute Engine, App Engine Flexible or from your own desktop.\n\n\n\n\n## Samples\n\nSamples are in the [`samples/`](https://github.com/googleapis/java-pubsub/tree/main/samples) directory.\n\n| Sample                      | Source Code                       | Try it |\n| --------------------------- | --------------------------------- | ------ |\n| Commit Avro Schema Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CommitAvroSchemaExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CommitAvroSchemaExample.java) |\n| Commit Proto Schema Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CommitProtoSchemaExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CommitProtoSchemaExample.java) |\n| Create Avro Schema Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CreateAvroSchemaExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CreateAvroSchemaExample.java) |\n| Create Big Query Subscription Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CreateBigQuerySubscriptionExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CreateBigQuerySubscriptionExample.java) |\n| Create Cloud Storage Subscription Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CreateCloudStorageSubscriptionExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CreateCloudStorageSubscriptionExample.java) |\n| Create Proto Schema Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CreateProtoSchemaExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CreateProtoSchemaExample.java) |\n| Create Pull Subscription Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CreatePullSubscriptionExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CreatePullSubscriptionExample.java) |\n| Create Push Subscription Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CreatePushSubscriptionExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CreatePushSubscriptionExample.java) |\n| Create Subscription With Dead Letter Policy Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CreateSubscriptionWithDeadLetterPolicyExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CreateSubscriptionWithDeadLetterPolicyExample.java) |\n| Create Subscription With Exactly Once Delivery | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CreateSubscriptionWithExactlyOnceDelivery.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CreateSubscriptionWithExactlyOnceDelivery.java) |\n| Create Subscription With Filtering | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CreateSubscriptionWithFiltering.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CreateSubscriptionWithFiltering.java) |\n| Create Subscription With Ordering | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CreateSubscriptionWithOrdering.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CreateSubscriptionWithOrdering.java) |\n| Create Subscription With Smt Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CreateSubscriptionWithSmtExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CreateSubscriptionWithSmtExample.java) |\n| Create Topic Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CreateTopicExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CreateTopicExample.java) |\n| Create Topic With Aws Msk Ingestion Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CreateTopicWithAwsMskIngestionExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CreateTopicWithAwsMskIngestionExample.java) |\n| Create Topic With Azure Event Hubs Ingestion Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CreateTopicWithAzureEventHubsIngestionExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CreateTopicWithAzureEventHubsIngestionExample.java) |\n| Create Topic With Cloud Storage Ingestion Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CreateTopicWithCloudStorageIngestionExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CreateTopicWithCloudStorageIngestionExample.java) |\n| Create Topic With Confluent Cloud Ingestion Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CreateTopicWithConfluentCloudIngestionExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CreateTopicWithConfluentCloudIngestionExample.java) |\n| Create Topic With Kinesis Ingestion Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CreateTopicWithKinesisIngestionExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CreateTopicWithKinesisIngestionExample.java) |\n| Create Topic With Schema Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CreateTopicWithSchemaExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CreateTopicWithSchemaExample.java) |\n| Create Topic With Schema Revisions Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CreateTopicWithSchemaRevisionsExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CreateTopicWithSchemaRevisionsExample.java) |\n| Create Topic With Smt Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CreateTopicWithSmtExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CreateTopicWithSmtExample.java) |\n| Create Unwrapped Push Subscription Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/CreateUnwrappedPushSubscriptionExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/CreateUnwrappedPushSubscriptionExample.java) |\n| Delete Schema Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/DeleteSchemaExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/DeleteSchemaExample.java) |\n| Delete Schema Revision Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/DeleteSchemaRevisionExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/DeleteSchemaRevisionExample.java) |\n| Delete Subscription Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/DeleteSubscriptionExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/DeleteSubscriptionExample.java) |\n| Delete Topic Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/DeleteTopicExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/DeleteTopicExample.java) |\n| Detach Subscription Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/DetachSubscriptionExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/DetachSubscriptionExample.java) |\n| Get Schema Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/GetSchemaExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/GetSchemaExample.java) |\n| Get Schema Revision Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/GetSchemaRevisionExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/GetSchemaRevisionExample.java) |\n| Get Subscription Policy Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/GetSubscriptionPolicyExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/GetSubscriptionPolicyExample.java) |\n| Get Topic Policy Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/GetTopicPolicyExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/GetTopicPolicyExample.java) |\n| List Schema Revisions Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/ListSchemaRevisionsExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/ListSchemaRevisionsExample.java) |\n| List Schemas Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/ListSchemasExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/ListSchemasExample.java) |\n| List Subscriptions In Project Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/ListSubscriptionsInProjectExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/ListSubscriptionsInProjectExample.java) |\n| List Subscriptions In Topic Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/ListSubscriptionsInTopicExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/ListSubscriptionsInTopicExample.java) |\n| List Topics Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/ListTopicsExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/ListTopicsExample.java) |\n| Open Telemetry Publisher Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/OpenTelemetryPublisherExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/OpenTelemetryPublisherExample.java) |\n| Open Telemetry Subscriber Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/OpenTelemetrySubscriberExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/OpenTelemetrySubscriberExample.java) |\n| Optimistic Subscribe Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/OptimisticSubscribeExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/OptimisticSubscribeExample.java) |\n| Publish Avro Records Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/PublishAvroRecordsExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/PublishAvroRecordsExample.java) |\n| Publish Protobuf Messages Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/PublishProtobufMessagesExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/PublishProtobufMessagesExample.java) |\n| Publish With Batch Settings Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/PublishWithBatchSettingsExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/PublishWithBatchSettingsExample.java) |\n| Publish With Concurrency Control Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/PublishWithConcurrencyControlExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/PublishWithConcurrencyControlExample.java) |\n| Publish With Custom Attributes Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/PublishWithCustomAttributesExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/PublishWithCustomAttributesExample.java) |\n| Publish With Error Handler Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/PublishWithErrorHandlerExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/PublishWithErrorHandlerExample.java) |\n| Publish With Flow Control Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/PublishWithFlowControlExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/PublishWithFlowControlExample.java) |\n| Publish With Grpc Compression Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/PublishWithGrpcCompressionExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/PublishWithGrpcCompressionExample.java) |\n| Publish With Ordering Keys | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/PublishWithOrderingKeys.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/PublishWithOrderingKeys.java) |\n| Publish With Retry Settings Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/PublishWithRetrySettingsExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/PublishWithRetrySettingsExample.java) |\n| Publisher Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/PublisherExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/PublisherExample.java) |\n| Receive Messages With Delivery Attempts Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/ReceiveMessagesWithDeliveryAttemptsExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/ReceiveMessagesWithDeliveryAttemptsExample.java) |\n| Remove Dead Letter Policy Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/RemoveDeadLetterPolicyExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/RemoveDeadLetterPolicyExample.java) |\n| Resume Publish With Ordering Keys | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/ResumePublishWithOrderingKeys.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/ResumePublishWithOrderingKeys.java) |\n| Rollback Schema Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/RollbackSchemaExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/RollbackSchemaExample.java) |\n| Set Subscription Policy Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/SetSubscriptionPolicyExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/SetSubscriptionPolicyExample.java) |\n| Set Topic Policy Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/SetTopicPolicyExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/SetTopicPolicyExample.java) |\n| Subscribe Async Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/SubscribeAsyncExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/SubscribeAsyncExample.java) |\n| Subscribe Sync Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/SubscribeSyncExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/SubscribeSyncExample.java) |\n| Subscribe Sync With Lease Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/SubscribeSyncWithLeaseExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/SubscribeSyncWithLeaseExample.java) |\n| Subscribe With Avro Schema Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/SubscribeWithAvroSchemaExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/SubscribeWithAvroSchemaExample.java) |\n| Subscribe With Avro Schema Revisions Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/SubscribeWithAvroSchemaRevisionsExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/SubscribeWithAvroSchemaRevisionsExample.java) |\n| Subscribe With Concurrency Control Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/SubscribeWithConcurrencyControlExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/SubscribeWithConcurrencyControlExample.java) |\n| Subscribe With Custom Attributes Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/SubscribeWithCustomAttributesExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/SubscribeWithCustomAttributesExample.java) |\n| Subscribe With Error Listener Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/SubscribeWithErrorListenerExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/SubscribeWithErrorListenerExample.java) |\n| Subscribe With Exactly Once Consumer With Response Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/SubscribeWithExactlyOnceConsumerWithResponseExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/SubscribeWithExactlyOnceConsumerWithResponseExample.java) |\n| Subscribe With Flow Control Settings Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/SubscribeWithFlowControlSettingsExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/SubscribeWithFlowControlSettingsExample.java) |\n| Subscribe With Proto Schema Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/SubscribeWithProtoSchemaExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/SubscribeWithProtoSchemaExample.java) |\n| Test Subscription Permissions Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/TestSubscriptionPermissionsExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/TestSubscriptionPermissionsExample.java) |\n| Test Topic Permissions Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/TestTopicPermissionsExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/TestTopicPermissionsExample.java) |\n| Update Dead Letter Policy Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/UpdateDeadLetterPolicyExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/UpdateDeadLetterPolicyExample.java) |\n| Update Push Configuration Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/UpdatePushConfigurationExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/UpdatePushConfigurationExample.java) |\n| Update Topic Schema Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/UpdateTopicSchemaExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/UpdateTopicSchemaExample.java) |\n| Update Topic Type Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/UpdateTopicTypeExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/UpdateTopicTypeExample.java) |\n| Use Pub Sub Emulator Example | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/pubsub/UsePubSubEmulatorExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/pubsub/UsePubSubEmulatorExample.java) |\n| State | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/utilities/State.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/utilities/State.java) |\n| State Proto | [source code](https://github.com/googleapis/java-pubsub/blob/main/samples/snippets/src/main/java/utilities/StateProto.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-pubsub\u0026page=editor\u0026open_in_editor=samples/snippets/src/main/java/utilities/StateProto.java) |\n\n\n\n## Troubleshooting\n\nTo get help, follow the instructions in the [shared Troubleshooting document][troubleshooting].\n\n## Transport\n\nCloud Pub/Sub uses both gRPC and HTTP/JSON for the transport layer.\n\n## Supported Java Versions\n\nJava 8 or above is required for using this client.\n\nGoogle's Java client libraries,\n[Google Cloud Client Libraries][cloudlibs]\nand\n[Google Cloud API Libraries][apilibs],\nfollow the\n[Oracle Java SE support roadmap][oracle]\n(see the Oracle Java SE Product Releases section).\n\n### For new development\n\nIn general, new feature development occurs with support for the lowest Java\nLTS version covered by  Oracle's Premier Support (which typically lasts 5 years\nfrom initial General Availability). If the minimum required JVM for a given\nlibrary is changed, it is accompanied by a [semver][semver] major release.\n\nJava 11 and (in September 2021) Java 17 are the best choices for new\ndevelopment.\n\n### Keeping production systems current\n\nGoogle tests its client libraries with all current LTS versions covered by\nOracle's Extended Support (which typically lasts 8 years from initial\nGeneral Availability).\n\n#### Legacy support\n\nGoogle's client libraries support legacy versions of Java runtimes with long\nterm stable libraries that don't receive feature updates on a best efforts basis\nas it may not be possible to backport all patches.\n\nGoogle provides updates on a best efforts basis to apps that continue to use\nJava 7, though apps might need to upgrade to current versions of the library\nthat supports their JVM.\n\n#### Where to find specific information\n\nThe latest versions and the supported Java versions are identified on\nthe individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME`\nand on [google-cloud-java][g-c-j].\n\n## Versioning\n\n\nThis library follows [Semantic Versioning](http://semver.org/).\n\n\n\n## Contributing\n\n\nContributions to this library are always welcome and highly encouraged.\n\nSee [CONTRIBUTING][contributing] for more information how to get started.\n\nPlease note that this project is released with a Contributor Code of Conduct. By participating in\nthis project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more\ninformation.\n\n\n## License\n\nApache 2.0 - See [LICENSE][license] for more information.\n\n## CI Status\n\nJava Version | Status\n------------ | ------\nJava 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2]\nJava 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3]\nJava 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4]\nJava 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5]\n\nJava is a registered trademark of Oracle and/or its affiliates.\n\n[product-docs]: https://cloud.google.com/pubsub/docs/\n[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-pubsub/latest/history\n[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-pubsub/java7.svg\n[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-pubsub/java7.html\n[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-pubsub/java8.svg\n[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-pubsub/java8.html\n[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-pubsub/java8-osx.svg\n[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-pubsub/java8-osx.html\n[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-pubsub/java8-win.svg\n[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-pubsub/java8-win.html\n[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-pubsub/java11.svg\n[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-pubsub/java11.html\n[stability-image]: https://img.shields.io/badge/stability-stable-green\n[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-pubsub.svg\n[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-pubsub/1.144.0\n[authentication]: https://github.com/googleapis/google-cloud-java#authentication\n[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes\n[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles\n[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy\n[developer-console]: https://console.developers.google.com/\n[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects\n[cloud-cli]: https://cloud.google.com/cli\n[troubleshooting]: https://github.com/googleapis/google-cloud-java/blob/main/TROUBLESHOOTING.md\n[contributing]: https://github.com/googleapis/java-pubsub/blob/main/CONTRIBUTING.md\n[code-of-conduct]: https://github.com/googleapis/java-pubsub/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct\n[license]: https://github.com/googleapis/java-pubsub/blob/main/LICENSE\n[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing\n[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=pubsub.googleapis.com\n[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM\n[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png\n\n[semver]: https://semver.org/\n[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained\n[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries\n[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html\n[g-c-j]: http://github.com/googleapis/google-cloud-java\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogleapis%2Fjava-pubsub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogleapis%2Fjava-pubsub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogleapis%2Fjava-pubsub/lists"}