import os, time, random, json, socket import redis from messaging import MQueue host = os.environ.get("REDIS_SVC", "redis-svc") port = int(os.environ.get("REDIS_PORT", "6379")) channel = os.environ.get("CHANNEL", "xqueue") queue = MQueue(channel, redis.Redis(host=host, port=port, db=0)) for since, msg in queue.listen(): # We would normally process the messages here. # However, to avoid overflowing the log we skip message processing. # You can print the message, if you want. # print(f"{ since }: { msg }") print()