Merge pull request #111 from stajkowski/master

Correct emit_log_topic.py
This commit is contained in:
Michael Klishin 2016-12-20 00:22:28 +03:00 committed by GitHub
commit a11afce9f0

View File

@ -9,7 +9,7 @@ channel = connection.channel()
channel.exchange_declare(exchange='topic_logs',
exchange_type='topic')
routing_key = sys.argv[1] if len(sys.argv) > 1 else 'anonymous.info'
routing_key = sys.argv[1] if len(sys.argv) > 2 else 'anonymous.info'
message = ' '.join(sys.argv[2:]) or 'Hello World!'
channel.basic_publish(exchange='topic_logs',
routing_key=routing_key,