From: Benjamin Diaz Date: Wed, 24 Oct 2018 19:52:42 +0000 (-0300) Subject: Adds time.sleep in Kafka validation loop X-Git-Tag: v5.0.0~18 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F58%2F6758%2F1;p=osm%2FMON.git Adds time.sleep in Kafka validation loop Adds max_poll_interval_ms=900000 in KafkaConsumer Signed-off-by: Benjamin Diaz --- diff --git a/osm_mon/core/message_bus/common_consumer.py b/osm_mon/core/message_bus/common_consumer.py index 85e679f..3e1f745 100755 --- a/osm_mon/core/message_bus/common_consumer.py +++ b/osm_mon/core/message_bus/common_consumer.py @@ -22,6 +22,7 @@ import json import logging import sys +import time from json import JSONDecodeError import six @@ -106,6 +107,7 @@ class CommonConsumer: log.exception("Exception: ") return retries = retries + 1 + time.sleep(2) log.info("Listening for messages...") for message in common_consumer: diff --git a/osm_mon/core/message_bus/consumer.py b/osm_mon/core/message_bus/consumer.py index 363b9fc..7936513 100644 --- a/osm_mon/core/message_bus/consumer.py +++ b/osm_mon/core/message_bus/consumer.py @@ -10,4 +10,5 @@ class Consumer(KafkaConsumer): super().__init__(bootstrap_servers=cfg.BROKER_URI, key_deserializer=bytes.decode, value_deserializer=bytes.decode, + max_poll_interval_ms=900000, group_id=group_id)