SAAS-56: RabbitMQ virtual host support

-Add support for specifying vhost in config files
This commit is contained in:
Martin Konecny 2011-12-05 21:05:28 -05:00
parent 2f1033ecb8
commit 21643a3734
9 changed files with 9 additions and 3 deletions

View file

@ -15,6 +15,7 @@ log_dir = '/var/log/airtime/show-recorder'
rabbitmq_host = 'localhost'
rabbitmq_user = 'guest'
rabbitmq_password = 'guest'
rabbitmq_vhost = '/'
############################################
# Recorded Audio settings #

View file

@ -183,7 +183,7 @@ class CommandListener():
try:
schedule_exchange = Exchange("airtime-show-recorder", "direct", durable=True, auto_delete=True)
schedule_queue = Queue("recorder-fetch", exchange=schedule_exchange, key="foo")
self.connection = BrokerConnection(config["rabbitmq_host"], config["rabbitmq_user"], config["rabbitmq_password"], "/")
self.connection = BrokerConnection(config["rabbitmq_host"], config["rabbitmq_user"], config["rabbitmq_password"], config["rabbitmq_vhost"])
channel = self.connection.channel()
consumer = Consumer(channel, schedule_queue)
consumer.register_callback(self.handle_message)