Make the event streamer transport URL configurable

This adds a way to configure the event streamer transport URL
so it can post to a different queue, e.g. Neutron's

Change-Id: I69d3d6d30e33878052f2c56b8c79a14cc4ec1b24
This commit is contained in:
German Eichberger 2017-10-23 13:41:29 -07:00
parent ba0f87f84a
commit 060fcc1503
4 changed files with 34 additions and 1 deletions

View File

@ -245,6 +245,14 @@
# Topic for octavia's events sent to a queue
# event_stream_topic = neutron_lbaas_event
# Transport URL to use for the neutron-lbaas synchronization event stream
# when neutron and octavia have separate queues.
# For Single Host, specify one full transport URL:
# event_stream_transport_url = rabbit://<user>:<pass>@127.0.0.1:5672/<vhost>
# For HA, specify queue nodes in cluster, comma delimited:
# event_stream_transport_url = rabbit://<user>:<pass>@server01,<user>:<pass>@server02/<vhost>
# event_stream_transport_url =
[house_keeping]
# Interval in seconds to initiate spare amphora checks
# spare_check_interval = 30

View File

@ -195,6 +195,10 @@ oslo_messaging_opts = [
cfg.StrOpt('event_stream_topic',
default='neutron_lbaas_event',
help=_('topic name for communicating events through a queue')),
cfg.StrOpt('event_stream_transport_url', default=None,
help=_('Transport URL to use for the neutron-lbaas'
'synchronization event stream when neutron and octavia'
'have separate queues.')),
]
haproxy_amphora_opts = [

View File

@ -60,7 +60,12 @@ class EventStreamerNeutron(EventStreamerBase):
def __init__(self):
topic = cfg.CONF.oslo_messaging.event_stream_topic
self.transport = oslo_messaging.get_rpc_transport(cfg.CONF)
if cfg.CONF.oslo_messaging.event_stream_transport_url:
# Use custom URL
self.transport = oslo_messaging.get_rpc_transport(
cfg.CONF, cfg.CONF.oslo_messaging.event_stream_transport_url)
else:
self.transport = oslo_messaging.get_rpc_transport(cfg.CONF)
self.target = oslo_messaging.Target(topic=topic, exchange="common",
namespace='control', fanout=False,
version='1.0')

View File

@ -0,0 +1,16 @@
---
features:
- |
In some enviornments (e.g. OSA) Neutron and Octavia use different queues
(at least different vhosts) and so if Octavia posts to the Octavia queue
and Neutron listens on the Neutron queue the events will never make it
over.
This adds a way to configure a custom queue for the event streamer thus
allowing to post messages to the Neutron queue if needed.
security:
- |
Depending on how the other queue is set up additional passwords for the
other queue will be in the Octavia config file. Operators should take care
of setting up appropriate users with appropriate restrictions to the
topic(s) needed.