Package com.google.cloud.pubsub.v1 (1.143.1)

GitHub Repository

Client Classes

Client classes are the main entry point to using a package.They contain several variations of Java methods for each of the API's methods.

ClientDescription
com.google.cloud.pubsub.v1.SchemaServiceClientService Description: Service for doing schema-related operations.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:

com.google.cloud.pubsub.v1.SubscriptionAdminClientService Description: The service that an application uses to manipulate subscriptions and to consume messages from a subscription via thePull method or by establishing a bi-directional stream using theStreamingPull method.
com.google.cloud.pubsub.v1.TopicAdminClientService Description: The service that an application uses to manipulate topics, and to send messages to a topic.

This class provides the ability to make remote calls to the backing service through method

Settings Classes

Settings classes can be used to configure credentials, endpoints, and retry settings for a Client.

SettingsDescription
com.google.cloud.pubsub.v1.SchemaServiceSettingsSettings class to configure an instance ofSchemaServiceClient.

The default instance has everything set to sensible defaults:

com.google.cloud.pubsub.v1.SubscriberShutdownSettingsSettings for configuring the shutdown behavior of aSubscriber.

This class allows customization of how the subscriber handles outstanding messages during shutdown, including whether to wait for processing to complete or to immediately nack messages,

com.google.cloud.pubsub.v1.SubscriptionAdminSettingsSettings class to configure an instance ofSubscriptionAdminClient.

The default instance has everything set to sensible defaults:

com.google.cloud.pubsub.v1.TopicAdminSettingsSettings class to configure an instance ofTopicAdminClient.

The default instance has everything set to sensible defaults:

Classes

ClassDescription
com.google.cloud.pubsub.v1.AckReplyConsumerImpl
com.google.cloud.pubsub.v1.AckReplyConsumerWithResponseImpl
com.google.cloud.pubsub.v1.AckRequestData
com.google.cloud.pubsub.v1.AckRequestData.BuilderBuilder ofAckRequestData.
com.google.cloud.pubsub.v1.OpenCensusUtilUtilities for propagating OpenCensusTagContext andSpanContext from publishers to subscribers.
com.google.cloud.pubsub.v1.OpenCensusUtil.OpenCensusMessageReceiverWrapper class forMessageReceiver that decodes any received trace and tag contexts and puts them in scope.
com.google.cloud.pubsub.v1.OpenTelemetryPubsubTracer
com.google.cloud.pubsub.v1.PublisherA Cloud Pub/Subpublisher, that is associated with a specific topic at creation.

APublisher provides built-in capabilities to automatically handle batching of

com.google.cloud.pubsub.v1.Publisher.BuilderA builder ofPublishers.
com.google.cloud.pubsub.v1.PubsubMessageWrapperA wrapper class for aPubsubMessage object that handles creation and tracking of OpenTelemetrySpan objects for different operations that occur during publishing.
com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemaRevisionsFixedSizeCollection
com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemaRevisionsPage
com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemaRevisionsPagedResponse
com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasFixedSizeCollection
com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPage
com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse
com.google.cloud.pubsub.v1.SchemaServiceSettings.BuilderBuilder for SchemaServiceSettings.
com.google.cloud.pubsub.v1.SubscriberA Cloud Pub/Subsubscriber that is associated with a specific subscription at creation.

ASubscriber allows you to provide an implementation of areceiver to which messages are going to be delivered as soon as they are received by the

com.google.cloud.pubsub.v1.Subscriber.BuilderBuilder ofSubscribers.
com.google.cloud.pubsub.v1.SubscriberShutdownSettings.BuilderBuilder forSubscriberShutdownSettings.
com.google.cloud.pubsub.v1.SubscriptionAdminClient.ListSnapshotsFixedSizeCollection
com.google.cloud.pubsub.v1.SubscriptionAdminClient.ListSnapshotsPage
com.google.cloud.pubsub.v1.SubscriptionAdminClient.ListSnapshotsPagedResponse
com.google.cloud.pubsub.v1.SubscriptionAdminClient.ListSubscriptionsFixedSizeCollection
com.google.cloud.pubsub.v1.SubscriptionAdminClient.ListSubscriptionsPage
com.google.cloud.pubsub.v1.SubscriptionAdminClient.ListSubscriptionsPagedResponse
com.google.cloud.pubsub.v1.SubscriptionAdminSettings.BuilderBuilder for SubscriptionAdminSettings.
com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSnapshotsFixedSizeCollection
com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSnapshotsPage
com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSnapshotsPagedResponse
com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSubscriptionsFixedSizeCollection
com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSubscriptionsPage
com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSubscriptionsPagedResponse
com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicsFixedSizeCollection
com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicsPage
com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicsPagedResponse
com.google.cloud.pubsub.v1.TopicAdminSettings.BuilderBuilder for TopicAdminSettings.

Interfaces

InterfaceDescription
com.google.cloud.pubsub.v1.AckReplyConsumerAccepts a reply, sending it to the service.
com.google.cloud.pubsub.v1.AckReplyConsumerWithResponseAcknowledging a message in Pub/Sub means that you are done with it, and it will not be delivered to this subscription again. You should avoid acknowledging messages until you havefinished processing them, so that in the event of a failure, you receive the message again.
com.google.cloud.pubsub.v1.MessageReceiverThis interface can be implemented by users ofSubscriber to receive messages.
com.google.cloud.pubsub.v1.MessageReceiverWithAckResponse
com.google.cloud.pubsub.v1.PublisherInterfaceAn interface for a Cloud Pub/Subpublisher.
com.google.cloud.pubsub.v1.SubscriberInterfaceThe core interface for a Cloud Pub/Subsubscriber, consisting only of ApiService methods.

Enums

EnumDescription
com.google.cloud.pubsub.v1.AckResponse
com.google.cloud.pubsub.v1.SubscriberShutdownSettings.ShutdownModeDefines the behavior for handling outstanding messages during subscriber shutdown.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-01 UTC.