diff options
| author | mjkwiatkowski <mati.rewa@gmail.com> | 2026-06-23 13:31:05 +0200 |
|---|---|---|
| committer | mjkwiatkowski <mati.rewa@gmail.com> | 2026-06-23 13:31:05 +0200 |
| commit | 81563cdb647b8de014a59fdc7e17fcd5ebf4be6c (patch) | |
| tree | 631cd8ff1f3f77d29739c7e1a06347a327caa7e7 /python_scripts/monitor.py | |
| parent | ca0c72789ba87791829001d259000b2966d9d6e4 (diff) | |
feat: managed to successfully run experiment I
Diffstat (limited to 'python_scripts/monitor.py')
| -rw-r--r-- | python_scripts/monitor.py | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/python_scripts/monitor.py b/python_scripts/monitor.py deleted file mode 100644 index 23b8c2c4..00000000 --- a/python_scripts/monitor.py +++ /dev/null @@ -1,24 +0,0 @@ -import redis -from redis import Redis -from redis_streams.consumer import Consumer - -STREAM="postgres_topic" -GROUP="python_consumer" - -# It is crucial to enable "decode_response" feature of Redis -redis_conn = Redis(decode_responses=True) -consumer = Consumer( - redis_conn=redis_conn, - stream=STREAM, - consumer_group=GROUP, - batch_size=10, - max_wait_time_ms=30000 - ) - - -while True: - messages = consumer.get_items() - total_no_of_messages = len(messages) - for i, item in enumerate(messages): - print(f"Pocessing {i}/{total_no_of_messages} message:{item}") - consumer.remove_item_from_consumer_group(item_id=item.msgid) |
