Use messaging notifications transport instead of default
The usage of oslo_messaging.get_transport is not meant for notifications; And oslo_messaging.get_notification_transport is favored for those means. So this change introduces the usage of that function. If the settings for the notifications are not set with the configuration that's under the oslo_messaging_notifications group, this will fall back to the old settings which are under the DEFAULT group; just like this used to work. Change-Id: Ic72fd658fe9b35d39cc3d7da2e4b9fe3454edfba
This commit is contained in:
@@ -22,6 +22,7 @@ from ironic.common import exception
|
|||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
TRANSPORT = None
|
TRANSPORT = None
|
||||||
|
NOTIFICATION_TRANSPORT = None
|
||||||
NOTIFIER = None
|
NOTIFIER = None
|
||||||
|
|
||||||
ALLOWED_EXMODS = [
|
ALLOWED_EXMODS = [
|
||||||
@@ -47,16 +48,23 @@ def init(conf):
|
|||||||
TRANSPORT = messaging.get_transport(conf,
|
TRANSPORT = messaging.get_transport(conf,
|
||||||
allowed_remote_exmods=exmods,
|
allowed_remote_exmods=exmods,
|
||||||
aliases=TRANSPORT_ALIASES)
|
aliases=TRANSPORT_ALIASES)
|
||||||
|
NOTIFICATION_TRANSPORT = messaging.get_notification_transport(
|
||||||
|
conf,
|
||||||
|
allowed_remote_exmods=exmods,
|
||||||
|
aliases=TRANSPORT_ALIASES)
|
||||||
serializer = RequestContextSerializer(messaging.JsonPayloadSerializer())
|
serializer = RequestContextSerializer(messaging.JsonPayloadSerializer())
|
||||||
NOTIFIER = messaging.Notifier(TRANSPORT, serializer=serializer)
|
NOTIFIER = messaging.Notifier(NOTIFICATION_TRANSPORT,
|
||||||
|
serializer=serializer)
|
||||||
|
|
||||||
|
|
||||||
def cleanup():
|
def cleanup():
|
||||||
global TRANSPORT, NOTIFIER
|
global TRANSPORT, NOTIFICATION_TRANSPORT, NOTIFIER
|
||||||
assert TRANSPORT is not None
|
assert TRANSPORT is not None
|
||||||
|
assert NOTIFICATION_TRANSPORT is not None
|
||||||
assert NOTIFIER is not None
|
assert NOTIFIER is not None
|
||||||
TRANSPORT.cleanup()
|
TRANSPORT.cleanup()
|
||||||
TRANSPORT = NOTIFIER = None
|
NOTIFICATION_TRANSPORT.cleanup()
|
||||||
|
TRANSPORT = NOTIFICATION_TRANSPORT = NOTIFIER = None
|
||||||
|
|
||||||
|
|
||||||
def set_defaults(control_exchange):
|
def set_defaults(control_exchange):
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- It is now possible to configure the notifications tu use a different
|
||||||
|
transport URL than the RPCs. These could potentially be completely
|
||||||
|
different message broker hosts (though they don't need to be). If the
|
||||||
|
notification-specific configuration is not provided, the notifier will use
|
||||||
|
the same transport as the RPCs.
|
||||||
|
|
||||||
Reference in New Issue
Block a user