Class KafkaSubscriber.Builder<K,V>

java.lang.Object
io.helidon.messaging.connectors.kafka.KafkaSubscriber.Builder<K,V>
Type Parameters:
K - Key type
V - Value type
All Implemented Interfaces:
Builder<KafkaSubscriber.Builder<K,V>,KafkaSubscriber<K,V>>, Supplier<KafkaSubscriber<K,V>>
Enclosing class:
KafkaSubscriber<K,V>

public static final class KafkaSubscriber.Builder<K,V> extends Object implements Builder<KafkaSubscriber.Builder<K,V>,KafkaSubscriber<K,V>>
Fluent API builder for KafkaSubscriber.
  • Method Details

    • build

      public KafkaSubscriber<K,V> build()
      Description copied from interface: Builder
      Build the instance from this builder.
      Specified by:
      build in interface Builder<K,V>
      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