0

def getKafkaConsumer(topicName, kafkaIP, kafkaPort, kafkaConsumerGroup): try: bootstrap = [str(kafkaIP + ':' + kafkaPort)] consumer = KafkaConsumer(topicName, bootstrap_servers = bootstrap, group_id = kafkaConsumerGroup, session_timeout_ms = 30000, api_version = (0,10)) return consumer except: import traceback print('Kafka Error: Check Kafka Consumer Settings!!')

In my application, producer is producing approx. 1000 messages per second but consumption rate is very slow. In above python code of consumer, please suggest how can I tune kafka parameters to increase consumption. And also suggest how can I create multiple consumers for same Topic.

1 Answers1

0

The max number of consumers you can spawn per Kafka topic is equal to the number of partitions in a kafka topic.

So increase the number of partitions and launch multiple consumers.

floating_hammer
  • 409
  • 3
  • 10