Class KafkaSubscriber.Builder<K,​V>

    • Method Detail

      • build

        public KafkaSubscriber<K,​V> build()
        Description copied from interface: Builder
        Build the instance from this builder.
        Specified by:
        build in interface Builder<K>
        Returns:
        instance of the built type
      • config

        public KafkaSubscriber.Builder<K,​V> config​(Config config)
        Load this builder from a configuration.
        Parameters:
        config - configuration to load from
        Returns:
        updated builder instance
      • producerSupplier

        public KafkaSubscriber.Builder<K,​V> producerSupplier​(Supplier<org.apache.kafka.clients.producer.Producer<K,​V>> producerSupplier)
        Defines how to instantiate the KafkaSubscriber. It will be invoked in KafkaSubscriber.onSubscribe(Subscription) This is a mandatory parameter.
        Parameters:
        producerSupplier - supply instantiated the KafkaSubscriber
        Returns:
        updated builder instance
      • backpressure

        public KafkaSubscriber.Builder<K,​V> backpressure​(long backpressure)
        Specifies the number of messages that are requested after processing them. The default value is 5.
        Parameters:
        backpressure - number of messages requested
        Returns:
        updated builder instance
      • topics

        public KafkaSubscriber.Builder<K,​V> topics​(List<String> topics)
        The list of topics the messages should be sent to. This is a mandatory parameter.
        Parameters:
        topics - list of the topics
        Returns:
        updated builder instance