diff options
author | Mehdi Abaakouk <mehdi.abaakouk@enovance.com> | 2014-03-03 16:06:01 +0100 |
---|---|---|
committer | Mehdi Abaakouk <mehdi.abaakouk@enovance.com> | 2014-04-22 10:59:59 +0200 |
commit | fa7a9733dc383f9f79362e05de053079d5fe105b (patch) | |
tree | e23d0bb136740e0d8e2f37edeb106c0641bfcbac /ceilometer/messaging.py | |
parent | aab1800d0d08189a3f2bbe008edccd4298ad2a86 (diff) | |
download | ceilometer-fa7a9733dc383f9f79362e05de053079d5fe105b.tar.gz |
Consume notif. from multiple message bus
This patch allow to consume notification from multiple
message bus servers at the same times with configuration like:
[DEFAULT]
transport_url = rabbit://rabbit-ceilo:5772/
[notification]
messaging_urls = rabbit://rabbit-nova1:5772,rabbit-nova2:5772/
messaging_urls = rabbit://rabbit-cinder:5772/
messaging_urls = rabbit://rabbit-neutron:5772/
Implements blueprint multiple-rabbitmq
Co-Authored-By: Ala Rezmerita <ala.rezmerita@cloudwatt.com>
Change-Id: If3bf6f080ce15f2403c3516b433953b0bdf6ea40
Diffstat (limited to 'ceilometer/messaging.py')
-rw-r--r-- | ceilometer/messaging.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ceilometer/messaging.py b/ceilometer/messaging.py index cd0c874e..9d739e7d 100644 --- a/ceilometer/messaging.py +++ b/ceilometer/messaging.py @@ -63,11 +63,16 @@ def get_rpc_client(**kwargs): return oslo.messaging.RPCClient(TRANSPORT, target) -def get_notification_listener(targets, endpoints): +def get_notification_listener(targets, endpoints, url=None): """Return a configured oslo.messaging notification listener.""" global TRANSPORT + if url: + transport = oslo.messaging.get_transport(cfg.CONF, url, + _ALIASES) + else: + transport = TRANSPORT return oslo.messaging.get_notification_listener( - TRANSPORT, targets, endpoints, executor='eventlet') + transport, targets, endpoints, executor='eventlet') def get_notifier(publisher_id): |