Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-3006

Make collection default container type for sequences in the consumer API

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 0.9.0.0
    • Fix Version/s: 0.10.0.0
    • Component/s: clients
    • Labels:
    • Flags:
      Patch

      Description

      The KafkaConsumer API has some annoying inconsistencies in the usage of collection types. For example, subscribe() takes a list, but subscription() returns a set. Similarly for assign() and assignment(). We also have pause() , seekToBeginning(), seekToEnd(), and resume() which annoyingly use a variable argument array, which means you have to copy the result of assignment() to an array if you want to pause all assigned partitions. We can solve these issues by adding the following variants:

      void subscribe(Collection<String> topics);
      void subscribe(Collection<String> topics, ConsumerRebalanceListener);
      void assign(Collection<TopicPartition> partitions);
      void pause(Collection<TopicPartition> partitions);
      void resume(Collection<TopicPartition> partitions);
      void seekToBeginning(Collection<TopicPartition>);
      void seekToEnd(Collection<TopicPartition>);
      

      This issues supersedes KAFKA-2991

        Attachments

          Activity

            People

            • Assignee:
              pyritschard Pierre-Yves Ritschard
              Reporter:
              pyritschard Pierre-Yves Ritschard
              Reviewer:
              Jason Gustafson
            • Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: