From e592e3ed8c0efa26a3b783163fe43696a4fb7a25 Mon Sep 17 00:00:00 2001 From: Benjamin Diaz Date: Wed, 24 Oct 2018 16:52:42 -0300 Subject: [PATCH] Adds time.sleep in Kafka validation loop Adds max_poll_interval_ms=900000 in KafkaConsumer Signed-off-by: Benjamin Diaz --- osm_mon/core/message_bus/common_consumer.py | 2 ++ osm_mon/core/message_bus/consumer.py | 1 + 2 files changed, 3 insertions(+) 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) -- 2.25.1