Class KafkaSubscriber.Builder<K,V>
- java.lang.Object
-
- io.helidon.messaging.connectors.kafka.KafkaSubscriber.Builder<K,V>
-
- Type Parameters:
K- Key typeV- Value type
- All Implemented Interfaces:
Builder<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<K,V>>
Fluent API builder forKafkaSubscriber.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KafkaSubscriber.Builder<K,V>backpressure(long backpressure)Specifies the number of messages that are requested after processing them.KafkaSubscriber<K,V>build()Build the instance from this builder.KafkaSubscriber.Builder<K,V>config(Config config)Load this builder from a configuration.KafkaSubscriber.Builder<K,V>producerSupplier(Supplier<org.apache.kafka.clients.producer.Producer<K,V>> producerSupplier)Defines how to instantiate the KafkaSubscriber.KafkaSubscriber.Builder<K,V>topics(List<String> topics)The list of topics the messages should be sent to.
-
-
-
Method Detail
-
build
public KafkaSubscriber<K,V> build()
Description copied from interface:BuilderBuild the instance from this builder.
-
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 inKafkaSubscriber.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
-
-