OUT
- The type of objects which will be readpublic static class PubSubSource.PubSubSourceBuilder<OUT> extends Object implements PubSubSource.ProjectNameBuilder<OUT>, PubSubSource.SubscriptionNameBuilder<OUT>
Modifier and Type | Method and Description |
---|---|
PubSubSource<OUT> |
build()
Actually build the desired instance of the PubSubSourceBuilder.
|
PubSubSource.PubSubSourceBuilder<OUT> |
withCredentials(com.google.auth.Credentials credentials)
Set the credentials.
|
PubSubSource.PubSubSourceBuilder<OUT> |
withMessageRateLimit(int messagePerSecondRateLimit)
Set a limit on the rate of messages per second received.
|
PubSubSource.SubscriptionNameBuilder<OUT> |
withProjectName(String projectName)
Set the project name of the subscription to pull messages from.
|
PubSubSource.PubSubSourceBuilder<OUT> |
withPubSubSubscriberFactory(int maxMessagesPerPull,
java.time.Duration perRequestTimeout,
int retries)
There is a default PubSubSubscriber factory that uses gRPC to pull in PubSub messages.
|
PubSubSource.PubSubSourceBuilder<OUT> |
withPubSubSubscriberFactory(PubSubSubscriberFactory pubSubSubscriberFactory)
Set a PubSubSubscriberFactory This allows for custom Subscriber options to be set.
|
PubSubSource.PubSubSourceBuilder<OUT> |
withSubscriptionName(String subscriptionName)
Set the subscription name of the subscription to pull messages from.
|
public PubSubSource.SubscriptionNameBuilder<OUT> withProjectName(String projectName)
PubSubSource.ProjectNameBuilder
withProjectName
in interface PubSubSource.ProjectNameBuilder<OUT>
public PubSubSource.PubSubSourceBuilder<OUT> withSubscriptionName(String subscriptionName)
PubSubSource.SubscriptionNameBuilder
withSubscriptionName
in interface PubSubSource.SubscriptionNameBuilder<OUT>
public PubSubSource.PubSubSourceBuilder<OUT> withCredentials(com.google.auth.Credentials credentials)
credentials
- the Credentials needed to connect.public PubSubSource.PubSubSourceBuilder<OUT> withPubSubSubscriberFactory(PubSubSubscriberFactory pubSubSubscriberFactory)
DefaultPubSubSubscriberFactory
is the default.pubSubSubscriberFactory
- A factory to create a Subscriber
public PubSubSource.PubSubSourceBuilder<OUT> withPubSubSubscriberFactory(int maxMessagesPerPull, java.time.Duration perRequestTimeout, int retries)
maxMessagesPerPull
- the number of messages pulled per request. Default: 100perRequestTimeout
- the timeout per request. Default: 15 secondsretries
- the number of retries when requests failpublic PubSubSource.PubSubSourceBuilder<OUT> withMessageRateLimit(int messagePerSecondRateLimit)
messagePerSecondRateLimit
- the message per second rate limit.public PubSubSource<OUT> build() throws IOException
IOException
- in case of a problem getting the credentialsIllegalArgumentException
- in case required fields were not specified.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.