Add NOTIFIER message topic can be specified by configuration file.

Change-Id: Ia348507343b561622d8d8e3c5fa0644e521a2edd
Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
This commit is contained in:
Yuanbin.Chen 2018-02-09 10:24:03 +08:00
parent f143759f0f
commit 66b4ead3b5
2 changed files with 8 additions and 1 deletions

View File

@ -206,6 +206,13 @@ notification_opts = [
cfg.CONF.register_group(notification_group)
cfg.CONF.register_opts(notification_opts, group=notification_group)
# Notification topic
notification_topic_opts = [
cfg.ListOpt('notification_topics',
default=['versioned_notifications'],
help=_('Default notification topic.'))]
cfg.CONF.register_opts(notification_topic_opts)
# Zaqar group
zaqar_group = cfg.OptGroup(
'zaqar', title='Zaqar Options',

View File

@ -94,7 +94,7 @@ def setup(url=None, optional=False):
serializer = RequestContextSerializer(JsonPayloadSerializer())
NOTIFIER = messaging.Notifier(NOTIFICATION_TRANSPORT,
serializer=serializer,
topics=['versioned_notifications'])
topics=cfg.CONF.notification_topics)
def cleanup():