Class KafkaConsumerFactory<K,​V>


  • public class KafkaConsumerFactory<K,​V>
    extends java.lang.Object
    Factory for KafkaConsumers 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 consumer
        position - where to start the consumption
        listener - ConsumerRebalanceListener for 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:
        KafkaConsumer of 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 consumption
        partitions - partitions to consume
        Returns:
        unnamed KafkaConsumer for given partitions
      • create

        public org.apache.kafka.clients.consumer.KafkaConsumer<K,​V> create()
        Create an unnamed consumer consuming all partitions.
        Returns:
        unnamed KafkaConsumer for all partitions