Class PubSubSource.PubSubSourceBuilder<OUT>

    • Method Detail

      • withCredentials

        public PubSubSource.PubSubSourceBuilder<OUT> withCredentials​(com.google.auth.Credentials credentials)
        Set the credentials. If this is not used then the credentials are picked up from the environment variables.
        Parameters:
        credentials - the Credentials needed to connect.
        Returns:
        The current PubSubSourceBuilder instance
      • withPubSubSubscriberFactory

        public PubSubSource.PubSubSourceBuilder<OUT> withPubSubSubscriberFactory​(PubSubSubscriberFactory pubSubSubscriberFactory)
        Set a PubSubSubscriberFactory This allows for custom Subscriber options to be set. DefaultPubSubSubscriberFactory is the default.
        Parameters:
        pubSubSubscriberFactory - A factory to create a Subscriber
        Returns:
        The current PubSubSourceBuilder instance
      • withPubSubSubscriberFactory

        public 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. This method can be used to tune this default factory. Note this will not work in combination with a custom PubSubSubscriber factory.
        Parameters:
        maxMessagesPerPull - the number of messages pulled per request. Default: 100
        perRequestTimeout - the timeout per request. Default: 15 seconds
        retries - the number of retries when requests fail
        Returns:
        The current PubSubSourceBuilder instance
      • withMessageRateLimit

        public PubSubSource.PubSubSourceBuilder<OUT> withMessageRateLimit​(int messagePerSecondRateLimit)
        Set a limit on the rate of messages per second received. This limit is per parallel instance of the source function. Default is set to 100000 messages per second.
        Parameters:
        messagePerSecondRateLimit - the message per second rate limit.