From a05148173432e439467e483cc14cab57ba35101a Mon Sep 17 00:00:00 2001 From: gradedSystem Date: Sun, 3 Sep 2023 01:16:16 +0200 Subject: [PATCH] updated requirements.txt --- kafka_integration/producer.py | 4 ++-- requirements.txt | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 requirements.txt diff --git a/kafka_integration/producer.py b/kafka_integration/producer.py index 2df8b3e..d4248ed 100644 --- a/kafka_integration/producer.py +++ b/kafka_integration/producer.py @@ -50,12 +50,12 @@ def delivery_callback(err, msg): location_json = json.dumps(product[entries[counter]]['location']).encode('utf-8') producer.produce(topics[0], key=json.dumps(entry).encode('utf-8'), value=location_json, callback=delivery_callback) time.sleep(2) - time.sleep(3) + time.sleep(1) for counter, entry in enumerate(entries, start=0): location_json = json.dumps(product[entries[counter]]['current']).encode('utf-8') producer.produce(topics[1], key=json.dumps(entry).encode('utf-8'), value=location_json, callback=delivery_callback) time.sleep(2) - time.sleep(30) + time.sleep(1) except KeyboardInterrupt: print("Received KeyboardInterrupt. Exiting gracefully.") # Block until the messages are sent. diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..d53b2bd --- /dev/null +++ b/requirements.txt @@ -0,0 +1,7 @@ +configparser==6.0.0 +confluent-kafka==2.2.0 +kafka-python==2.0.2 +requests==2.31.0 +virtualenv==20.24.4 +pyspark==3.24 +