google-cloud-pubsublite overview (1.4.12)

com.google.cloud.pubsublite

com.google.cloud.pubsublite.cloudpubsub

com.google.cloud.pubsublite.cloudpubsub.internal

com.google.cloud.pubsublite.internal

com.google.cloud.pubsublite.internal.testing

com.google.cloud.pubsublite.internal.wire

com.google.cloud.pubsublite.proto

com.google.cloud.pubsublite.v1

The interfaces provided are listed below, along with usage samples.

AdminServiceClient

Service Description: The service that a client application uses to manage topics and subscriptions, such creating, listing, and deleting topics and subscriptions.

Sample for AdminServiceClient:

   
 try 
  
 ( 
 AdminServiceClient 
  
 adminServiceClient 
  
 = 
  
 AdminServiceClient 
 . 
 create 
 ()) 
  
 { 
  
 LocationName 
  
 parent 
  
 = 
  
 LocationName 
 . 
 of 
 ( 
 "[PROJECT]" 
 , 
  
 "[LOCATION]" 
 ); 
  
 Topic 
  
 topic 
  
 = 
  
 Topic 
 . 
 newBuilder 
 (). 
 build 
 (); 
  
 String 
  
 topicId 
  
 = 
  
 "topicId-1139259734" 
 ; 
  
 Topic 
  
 response 
  
 = 
  
 adminServiceClient 
 . 
 createTopic 
 ( 
 parent 
 , 
  
 topic 
 , 
  
 topicId 
 ); 
  
 } 
  
 

CursorServiceClient

Service Description: The service that a subscriber client application uses to manage committed cursors while receiving messsages. A cursor represents a subscriber's progress within a topic partition for a given subscription.

Sample for CursorServiceClient:

   
 try 
  
 ( 
 CursorServiceClient 
  
 cursorServiceClient 
  
 = 
  
 CursorServiceClient 
 . 
 create 
 ()) 
  
 { 
  
 CommitCursorRequest 
  
 request 
  
 = 
  
 CommitCursorRequest 
 . 
 newBuilder 
 () 
  
 . 
 setSubscription 
 ( 
 "subscription341203229" 
 ) 
  
 . 
 setPartition 
 ( 
 - 
 1799810326 
 ) 
  
 . 
 setCursor 
 ( 
 Cursor 
 . 
 newBuilder 
 (). 
 build 
 ()) 
  
 . 
 build 
 (); 
  
 CommitCursorResponse 
  
 response 
  
 = 
  
 cursorServiceClient 
 . 
 commitCursor 
 ( 
 request 
 ); 
  
 } 
  
 

PublisherServiceClient

Service Description: The service that a publisher client application uses to publish messages to topics. Published messages are retained by the service for the duration of the retention period configured for the respective topic, and are delivered to subscriber clients upon request (via the SubscriberService ).

Sample for PublisherServiceClient:

   
 try 
  
 ( 
 PublisherServiceClient 
  
 publisherServiceClient 
  
 = 
  
 PublisherServiceClient 
 . 
 create 
 ()) 
  
 { 
  
 BidiStream 
 

SubscriberServiceClient

Service Description: The service that a subscriber client application uses to receive messages from subscriptions.

Sample for SubscriberServiceClient:

   
 try 
  
 ( 
 SubscriberServiceClient 
  
 subscriberServiceClient 
  
 = 
  
 SubscriberServiceClient 
 . 
 create 
 ()) 
  
 { 
  
 BidiStream 
 

PartitionAssignmentServiceClient

Service Description: The service that a subscriber client application uses to determine which partitions it should connect to.

Sample for PartitionAssignmentServiceClient:

   
 try 
  
 ( 
 PartitionAssignmentServiceClient 
  
 partitionAssignmentServiceClient 
  
 = 
  
 PartitionAssignmentServiceClient 
 . 
 create 
 ()) 
  
 { 
  
 BidiStream 
 

TopicStatsServiceClient

Service Description: This service allows users to get stats about messages in their topic.

Sample for TopicStatsServiceClient:

   
 try 
  
 ( 
 TopicStatsServiceClient 
  
 topicStatsServiceClient 
  
 = 
  
 TopicStatsServiceClient 
 . 
 create 
 ()) 
  
 { 
  
 ComputeMessageStatsRequest 
  
 request 
  
 = 
  
 ComputeMessageStatsRequest 
 . 
 newBuilder 
 () 
  
 . 
 setTopic 
 ( 
 TopicName 
 . 
 of 
 ( 
 "[PROJECT]" 
 , 
  
 "[LOCATION]" 
 , 
  
 "[TOPIC]" 
 ). 
 toString 
 ()) 
  
 . 
 setPartition 
 ( 
 - 
 1799810326 
 ) 
  
 . 
 setStartCursor 
 ( 
 Cursor 
 . 
 newBuilder 
 (). 
 build 
 ()) 
  
 . 
 setEndCursor 
 ( 
 Cursor 
 . 
 newBuilder 
 (). 
 build 
 ()) 
  
 . 
 build 
 (); 
  
 ComputeMessageStatsResponse 
  
 response 
  
 = 
  
 topicStatsServiceClient 
 . 
 computeMessageStats 
 ( 
 request 
 ); 
  
 } 
  
 

com.google.cloud.pubsublite.v1.stub

Design a Mobile Site
View Site in Mobile | Classic
Share by: