in src/main/java/com/spotify/google/cloud/pubsub/client/Puller.java [107:138]
public Puller(final Builder builder) {
this.pubsub = Objects.requireNonNull(builder.pubsub, "pubsub");
this.project = Objects.requireNonNull(builder.project, "project");
this.subscription = Objects.requireNonNull(builder.subscription, "subscription");
this.handler = Objects.requireNonNull(builder.handler, "handler");
this.concurrency = builder.concurrency;
this.batchSize = builder.batchSize;
this.maxOutstandingMessages = builder.maxOutstandingMessages;
this.maxAckQueueSize = builder.maxAckQueueSize;
this.pullIntervalMillis = builder.pullIntervalMillis;
this.backoff = Backoff.builder()
.initialInterval(builder.pullIntervalMillis)
.maxBackoffMultiplier(builder.maxBackoffMultiplier)
.build();
// Set up a batching acker for sending acks
this.acker = Acker.builder()
.pubsub(pubsub)
.project(project)
.subscription(subscription)
.batchSize(batchSize)
.concurrency(concurrency)
.queueSize(maxAckQueueSize)
.build();
// Start pulling
pull();
// Schedule pulling to compensate for failures and exceeding the outstanding message limit
scheduler.scheduleWithFixedDelay(this::pull, pullIntervalMillis, pullIntervalMillis, MILLISECONDS);
}