Class PublisherBuilder (1.12.22)

public abstract class PublisherBuilder

A builder for a PubSub Lite Publisher. Basic usage:


 Publisher<Offset> publisher = PublisherBuilder.builder()
   .setTopic(
     TopicPath.newBuilder()
       .setProject(MY_PROJECT)
       .setName(MY_TOPIC)
       .setLocation(CloudZone.of("us-east1-a"))
       .build())
  .setPartition(Partition.of(10))
  .build();
 

A custom service client can also be set.

Inheritance

java.lang.Object > PublisherBuilder

Static Fields

DISABLED_BATCHING_SETTINGS

public static final BatchingSettings DISABLED_BATCHING_SETTINGS
Field Value
TypeDescription
BatchingSettings

Static Methods

builder()

public static PublisherBuilder.Builder builder()
Returns
TypeDescription
PublisherBuilder.Builder

Constructors

PublisherBuilder()

public PublisherBuilder()