From d5f5905e9f35759d1859a2bc877fba8e9cfbe89e Mon Sep 17 00:00:00 2001 From: Alexey Shkarupin Date: Fri, 29 Nov 2019 11:10:00 +0200 Subject: [PATCH] add assertion error for easier debugging --- frontera/contrib/messagebus/kafkabus.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontera/contrib/messagebus/kafkabus.py b/frontera/contrib/messagebus/kafkabus.py index c4ddf8401..10e5d5b53 100644 --- a/frontera/contrib/messagebus/kafkabus.py +++ b/frontera/contrib/messagebus/kafkabus.py @@ -190,7 +190,8 @@ def __init__(self, messagebus): def consumer(self, partition_id): c = Consumer(self._location, self._enable_ssl, self._cert_path, self._topic, self._general_group, partition_id) - assert len(c._consumer.partitions_for_topic(self._topic)) == self._partitions + assert len(c._consumer.partitions_for_topic(self._topic)) == self._partitions, \ + "Number of kafka topic partitions doesn't match value in config for spider feed" return c def available_partitions(self):