K
- V
- public static class ConsumerContainer.DynamicPool<K,V> extends Object
ConsumerContainer
s (typically configured with the same group.id)
sized dynamically by setConsumerThreads(int)
Constructor and Description |
---|
DynamicPool(Properties consumerProperties,
org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer,
org.apache.kafka.common.serialization.Deserializer<V> valueDeserializer,
String topic,
int initialConsumerThreads,
Oneof2<Consumer<? super org.apache.kafka.clients.consumer.ConsumerRecord<K,V>>,Consumer<? super org.apache.kafka.clients.consumer.ConsumerRecords<K,V>>> recordOrRecordsConsumer) |
Modifier and Type | Method and Description |
---|---|
int |
getConsumerThreads() |
boolean |
isRunning() |
void |
setConsumerThreads(int consumerThreads)
Resize the consumer pool as requested.
|
void |
start() |
void |
stop() |
public DynamicPool(Properties consumerProperties, org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer, org.apache.kafka.common.serialization.Deserializer<V> valueDeserializer, String topic, int initialConsumerThreads, Oneof2<Consumer<? super org.apache.kafka.clients.consumer.ConsumerRecord<K,V>>,Consumer<? super org.apache.kafka.clients.consumer.ConsumerRecords<K,V>>> recordOrRecordsConsumer)
public int getConsumerThreads()
public void setConsumerThreads(int consumerThreads)
consumerThreads
- number of consumer threads to set this pool to dynamicallypublic void start()
public void stop()
public boolean isRunning()
Copyright © 2019 Red Hat. All rights reserved.