public class PubsubGrpcClient extends PubsubClient
PubsubClient.IncomingMessage, PubsubClient.OutgoingMessage, PubsubClient.ProjectPath, PubsubClient.PubsubClientFactory, PubsubClient.SchemaPath, PubsubClient.SubscriptionPath, PubsubClient.TopicPath| Modifier and Type | Field and Description | 
|---|---|
| static PubsubClient.PubsubClientFactory | FACTORYFactory for creating Pubsub clients using gRPC transport. | 
| Modifier and Type | Method and Description | 
|---|---|
| int | ackDeadlineSeconds(PubsubClient.SubscriptionPath subscription)Return the ack deadline, in seconds, for  subscription. | 
| void | acknowledge(PubsubClient.SubscriptionPath subscription,
           java.util.List<java.lang.String> ackIds)Acknowldege messages from  subscriptionwithackIds. | 
| void | close()Gracefully close the underlying netty channel. | 
| void | createSchema(PubsubClient.SchemaPath schemaPath,
            java.lang.String schemaContent,
            com.google.pubsub.v1.Schema.Type type)Create  Schemafrom Schema definition content. | 
| void | createSubscription(PubsubClient.TopicPath topic,
                  PubsubClient.SubscriptionPath subscription,
                  int ackDeadlineSeconds)Create  subscriptiontotopic. | 
| void | createTopic(PubsubClient.TopicPath topic)Create  topic. | 
| void | createTopic(PubsubClient.TopicPath topic,
           PubsubClient.SchemaPath schema)Create {link TopicPath} with  PubsubClient.SchemaPath. | 
| void | deleteSchema(PubsubClient.SchemaPath schemaPath)Delete  SchemaPath. | 
| void | deleteSubscription(PubsubClient.SubscriptionPath subscription)Delete  subscription. | 
| void | deleteTopic(PubsubClient.TopicPath topic) | 
| Schema | getSchema(PubsubClient.SchemaPath schemaPath)Return a Beam  Schemafrom the Pub/Sub schema resource, if exists. | 
| PubsubClient.SchemaPath | getSchemaPath(PubsubClient.TopicPath topicPath)Return  SchemaPathfromTopicPathif exists. | 
| boolean | isEOF()Return true if  PubsubClient.pull(long, org.apache.beam.sdk.io.gcp.pubsub.PubsubClient.SubscriptionPath, int, boolean)will always return empty list. | 
| boolean | isTopicExists(PubsubClient.TopicPath topic)Return true if  topicexists. | 
| java.util.List<PubsubClient.SubscriptionPath> | listSubscriptions(PubsubClient.ProjectPath project,
                 PubsubClient.TopicPath topic)Return a list of subscriptions for  topicinproject. | 
| java.util.List<PubsubClient.TopicPath> | listTopics(PubsubClient.ProjectPath project)Return a list of topics for  project. | 
| void | modifyAckDeadline(PubsubClient.SubscriptionPath subscription,
                 java.util.List<java.lang.String> ackIds,
                 int deadlineSeconds)Modify the ack deadline for messages from  subscriptionwithackIdsto bedeadlineSecondsfrom now. | 
| int | publish(PubsubClient.TopicPath topic,
       java.util.List<PubsubClient.OutgoingMessage> outgoingMessages)Publish  outgoingMessagesto Pubsubtopic. | 
| java.util.List<PubsubClient.IncomingMessage> | pull(long requestTimeMsSinceEpoch,
    PubsubClient.SubscriptionPath subscription,
    int batchSize,
    boolean returnImmediately)Request the next batch of up to  batchSizemessages fromsubscription. | 
createRandomSubscription, extractTimestampAttribute, parseTimestampAsMsSinceEpoch, projectPathFromId, projectPathFromPath, schemaPathFromId, schemaPathFromPath, subscriptionPathFromName, subscriptionPathFromPath, topicPathFromName, topicPathFromPathpublic static final PubsubClient.PubsubClientFactory FACTORY
public void close()
public int publish(PubsubClient.TopicPath topic, java.util.List<PubsubClient.OutgoingMessage> outgoingMessages) throws java.io.IOException
PubsubClientoutgoingMessages to Pubsub topic. Return number of messages published.publish in class PubsubClientjava.io.IOExceptionpublic java.util.List<PubsubClient.IncomingMessage> pull(long requestTimeMsSinceEpoch, PubsubClient.SubscriptionPath subscription, int batchSize, boolean returnImmediately) throws java.io.IOException
PubsubClientbatchSize messages from subscription. Return
 the received messages, or empty collection if none were available. Does not wait for messages
 to arrive if returnImmediately is true. Returned messages will record their
 request time as requestTimeMsSinceEpoch.pull in class PubsubClientjava.io.IOExceptionpublic void acknowledge(PubsubClient.SubscriptionPath subscription, java.util.List<java.lang.String> ackIds) throws java.io.IOException
PubsubClientsubscription with ackIds.acknowledge in class PubsubClientjava.io.IOExceptionpublic void modifyAckDeadline(PubsubClient.SubscriptionPath subscription, java.util.List<java.lang.String> ackIds, int deadlineSeconds) throws java.io.IOException
PubsubClientsubscription with ackIds to be deadlineSeconds from now.modifyAckDeadline in class PubsubClientjava.io.IOExceptionpublic void createTopic(PubsubClient.TopicPath topic) throws java.io.IOException
PubsubClienttopic.createTopic in class PubsubClientjava.io.IOExceptionpublic void createTopic(PubsubClient.TopicPath topic, PubsubClient.SchemaPath schema) throws java.io.IOException
PubsubClientPubsubClient.SchemaPath.createTopic in class PubsubClientjava.io.IOExceptionpublic void deleteTopic(PubsubClient.TopicPath topic) throws java.io.IOException
deleteTopic in class PubsubClientjava.io.IOExceptionpublic java.util.List<PubsubClient.TopicPath> listTopics(PubsubClient.ProjectPath project) throws java.io.IOException
PubsubClientproject.listTopics in class PubsubClientjava.io.IOExceptionpublic boolean isTopicExists(PubsubClient.TopicPath topic) throws java.io.IOException
PubsubClienttopic exists.isTopicExists in class PubsubClientjava.io.IOExceptionpublic void createSubscription(PubsubClient.TopicPath topic, PubsubClient.SubscriptionPath subscription, int ackDeadlineSeconds) throws java.io.IOException
PubsubClientsubscription to topic.createSubscription in class PubsubClientjava.io.IOExceptionpublic void deleteSubscription(PubsubClient.SubscriptionPath subscription) throws java.io.IOException
PubsubClientsubscription.deleteSubscription in class PubsubClientjava.io.IOExceptionpublic java.util.List<PubsubClient.SubscriptionPath> listSubscriptions(PubsubClient.ProjectPath project, PubsubClient.TopicPath topic) throws java.io.IOException
PubsubClienttopic in project.listSubscriptions in class PubsubClientjava.io.IOExceptionpublic int ackDeadlineSeconds(PubsubClient.SubscriptionPath subscription) throws java.io.IOException
PubsubClientsubscription.ackDeadlineSeconds in class PubsubClientjava.io.IOExceptionpublic boolean isEOF()
PubsubClientPubsubClient.pull(long, org.apache.beam.sdk.io.gcp.pubsub.PubsubClient.SubscriptionPath, int, boolean) will always return empty list. Actual clients will
 return false. Test clients may return true to signal that all expected
 messages have been pulled and the test may complete.isEOF in class PubsubClientpublic void createSchema(PubsubClient.SchemaPath schemaPath, java.lang.String schemaContent, com.google.pubsub.v1.Schema.Type type) throws java.io.IOException
Schema from Schema definition content.createSchema in class PubsubClientjava.io.IOExceptionpublic void deleteSchema(PubsubClient.SchemaPath schemaPath) throws java.io.IOException
SchemaPath.deleteSchema in class PubsubClientjava.io.IOExceptionpublic PubsubClient.SchemaPath getSchemaPath(PubsubClient.TopicPath topicPath) throws java.io.IOException
SchemaPath from TopicPath if exists.getSchemaPath in class PubsubClientjava.io.IOExceptionpublic Schema getSchema(PubsubClient.SchemaPath schemaPath) throws java.io.IOException
Schema from the Pub/Sub schema resource, if exists.getSchema in class PubsubClientjava.io.IOException