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.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 Summary
Modifier and TypeMethodDescriptionbackpressure
(long backpressure) Specifies the number of messages that are requested after processing them.build()
Build the instance from this builder.Load this builder from a configuration.producerSupplier
(Supplier<org.apache.kafka.clients.producer.Producer<K, V>> producerSupplier) Defines how to instantiate the KafkaSubscriber.The list of topics the messages should be sent to.
-
Method Details
-
build
Description copied from interface:Builder
Build the instance from this builder. -
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
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
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
-