pykafka
pykafka copied to clipboard
KeyError on creating duplicate topic and for invalid replication factor
- 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
- 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:
Generally in the code (pyKafka: 2.8.0) is more missing codes. Look into documentation: Protocol error codes