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

Inconsistent exception type from KafkaConsumer.position

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0
    • Component/s: consumer
    • Labels:
      None

      Description

      If KafkaConsumer.position is called with a partition that the consumer isn't assigned, it throws an IllegalArgumentException. All other APIs throw an IllegalStateException when the consumer tries to act on a partition that is not assigned to the consumer.

      Looking at the implementation, if it weren't for subscription test and IllegalArgumentException thrown at the beginning of KafkaConsumer.position, the very next line would throw an IllegalStateException anyway.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jkahrman Jay Kahrman
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: