diff --git a/ironic/common/rpc.py b/ironic/common/rpc.py index 212bec699c..7c02be69b0 100644 --- a/ironic/common/rpc.py +++ b/ironic/common/rpc.py @@ -22,6 +22,7 @@ from ironic.common import exception CONF = cfg.CONF TRANSPORT = None +NOTIFICATION_TRANSPORT = None NOTIFIER = None ALLOWED_EXMODS = [ @@ -47,16 +48,23 @@ def init(conf): TRANSPORT = messaging.get_transport(conf, allowed_remote_exmods=exmods, aliases=TRANSPORT_ALIASES) + NOTIFICATION_TRANSPORT = messaging.get_notification_transport( + conf, + allowed_remote_exmods=exmods, + aliases=TRANSPORT_ALIASES) serializer = RequestContextSerializer(messaging.JsonPayloadSerializer()) - NOTIFIER = messaging.Notifier(TRANSPORT, serializer=serializer) + NOTIFIER = messaging.Notifier(NOTIFICATION_TRANSPORT, + serializer=serializer) def cleanup(): - global TRANSPORT, NOTIFIER + global TRANSPORT, NOTIFICATION_TRANSPORT, NOTIFIER assert TRANSPORT is not None + assert NOTIFICATION_TRANSPORT is not None assert NOTIFIER is not None TRANSPORT.cleanup() - TRANSPORT = NOTIFIER = None + NOTIFICATION_TRANSPORT.cleanup() + TRANSPORT = NOTIFICATION_TRANSPORT = NOTIFIER = None def set_defaults(control_exchange): diff --git a/releasenotes/notes/configure-notifications-72824356e7d8832a.yaml b/releasenotes/notes/configure-notifications-72824356e7d8832a.yaml new file mode 100644 index 0000000000..c3ba116469 --- /dev/null +++ b/releasenotes/notes/configure-notifications-72824356e7d8832a.yaml @@ -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. +