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_as_group(group="consumers"): print(f"{ since }: { msg }")