You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Jay Kahrman (JIRA)" <ji...@apache.org> on 2018/01/05 17:50:00 UTC

[jira] [Created] (KAFKA-6427) Inconsistent exception type from KafkaConsumer.position

Jay Kahrman created KAFKA-6427:
----------------------------------

             Summary: Inconsistent exception type from KafkaConsumer.position
                 Key: KAFKA-6427
                 URL: https://issues.apache.org/jira/browse/KAFKA-6427
             Project: Kafka
          Issue Type: Bug
          Components: consumer
            Reporter: Jay Kahrman
            Priority: Trivial


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.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)