pykafka icon indicating copy to clipboard operation
pykafka copied to clipboard

KeyError on creating duplicate topic and for invalid replication factor

Open girishsv1986 opened this issue 7 years ago • 1 comments

  1. When I'm trying to create topic with the same name that already exists on kafka server, kafka log shows error, org.apache.kafka.common.errors.TopicExistsException: Topic 'topic-1' already exists. However, pykafka ends up throwing KeyError 36, which I think is library error code to handle duplicate topic error but the exception class for same is not present in exceptions.py

Attached is the sample script, I'm trying

test_kafa_topic_creation.zip

  1. Same issue occurs, when I provide replication factor more than running fakfa instance, but this time KeyError is for 38. In above script, change replication factor to 2 and make sure only one fakfa instance is running. Kafka log message - org.apache.kafka.common.errors.InvalidReplicationFactorException: Replication factor: 2 larger than available brokers: 1.

PyKafka version: 2.7.0 Kafka version:

girishsv1986 avatar May 16 '18 17:05 girishsv1986

Generally in the code (pyKafka: 2.8.0) is more missing codes. Look into documentation: Protocol error codes

mellonedain avatar May 30 '19 10:05 mellonedain