From 9aa02339e730988cc1174103e3091690f3c8a42d Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 29 Mar 2017 15:22:03 -0700 Subject: [PATCH] Fix for direct message routing using a 'real' exchange like rabbitmq -- this worked with local/database connections already, if accidentally. I want to do more refactoring of how these are configured, but am deferring that for now as it's not a priority. --- lib/galaxy/queue_worker.py | 4 ++-- lib/galaxy/queues.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/queue_worker.py b/lib/galaxy/queue_worker.py index 0ca7b928d77..583cab1d831 100644 --- a/lib/galaxy/queue_worker.py +++ b/lib/galaxy/queue_worker.py @@ -24,7 +24,7 @@ def send_local_control_task(app, task, kwargs={}): This sends a message to the process-local control worker, which is useful for one-time asynchronous tasks like recalculating user disk usage. """ - log.info("Queuing async task %s." % task) + log.info("Queuing async task %s for %s." % (task, app.config.server_name)) payload = {'task': task, 'kwargs': kwargs} try: @@ -33,7 +33,7 @@ def send_local_control_task(app, task, kwargs={}): producer.publish(payload, exchange=galaxy.queues.galaxy_exchange, declare=[galaxy.queues.galaxy_exchange] + [galaxy.queues.control_queue_from_config(app.config)], - routing_key='control') + routing_key='control.%s' % app.config.server_name) except Exception: log.exception("Error queueing async task: %s." % payload) diff --git a/lib/galaxy/queues.py b/lib/galaxy/queues.py index 150c4163e64..18bf9f86af4 100644 --- a/lib/galaxy/queues.py +++ b/lib/galaxy/queues.py @@ -31,7 +31,9 @@ def control_queue_from_config(config): Returns a Queue instance with the correct name and routing key for this galaxy process's config """ - return Queue("control.%s" % config.server_name, galaxy_exchange, routing_key='control') + return Queue("control.%s" % config.server_name, + galaxy_exchange, + routing_key='control.%s' % config.server_name) def connection_from_config(config):