Package cz.o2.proxima.direct.io.kafka
Class KafkaConsumerFactory<K,V>
- java.lang.Object
-
- cz.o2.proxima.direct.io.kafka.KafkaConsumerFactory<K,V>
-
public class KafkaConsumerFactory<K,V> extends java.lang.ObjectFactory forKafkaConsumers attached to the given commit log.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.kafka.clients.consumer.KafkaConsumer<K,V>create()Create an unnamed consumer consuming all partitions.org.apache.kafka.clients.consumer.KafkaConsumer<K,V>create(Position position, java.util.Collection<Partition> partitions)Create unnamed consumer consuming given partitions.org.apache.kafka.clients.consumer.KafkaConsumer<K,V>create(java.lang.String name)Create kafka consumer based on given parameters.org.apache.kafka.clients.consumer.KafkaConsumer<K,V>create(java.lang.String name, Position position, org.apache.kafka.clients.consumer.ConsumerRebalanceListener listener)Create named consumer consuming from given position.
-
-
-
Method Detail
-
create
public org.apache.kafka.clients.consumer.KafkaConsumer<K,V> create(java.lang.String name, Position position, @Nullable org.apache.kafka.clients.consumer.ConsumerRebalanceListener listener)
Create named consumer consuming from given position.- Parameters:
name- name of the consumerposition- where to start the consumptionlistener-ConsumerRebalanceListenerfor assignment changes- Returns:
- named
KafkaConsumer
-
create
public org.apache.kafka.clients.consumer.KafkaConsumer<K,V> create(java.lang.String name)
Create kafka consumer based on given parameters.- Parameters:
name- name of the consumer- Returns:
KafkaConsumerof given name
-
create
public org.apache.kafka.clients.consumer.KafkaConsumer<K,V> create(Position position, java.util.Collection<Partition> partitions)
Create unnamed consumer consuming given partitions.- Parameters:
position- whete to start the consumptionpartitions- partitions to consume- Returns:
- unnamed
KafkaConsumerfor given partitions
-
-