Notification Driver

Notification Driver

Notification drivers for sending notifications via messaging.

The messaging drivers publish notification messages to notification listeners.

The driver will block the notifier’s thread until the notification message has been passed to the messaging transport. There is no guarantee that the notification message will be consumed by a notification listener.

Notification messages are sent ‘at-most-once’ - ensuring that they are not duplicated.

If the connection to the messaging service is not active when a notification is sent this driver will block waiting for the connection to complete. If the connection fails to complete, the driver will try to re-establish that connection. By default this will continue indefinitely until the connection completes. However, the retry parameter can be used to have the notification send fail with a MessageDeliveryFailure after the given number of retries.

class oslo_messaging.notify.messaging.MessagingDriver(conf, topics, transport, version=1.0)

Send notifications using the 1.0 message format.

This driver sends notifications over the configured messaging transport, but without any message envelope (also known as message format 1.0).

This driver should only be used in cases where there are existing consumers deployed which do not support the 2.0 message format.

class oslo_messaging.notify.messaging.MessagingV2Driver(conf, **kwargs)

Send notifications using the 2.0 message format.

class oslo_messaging.notify.notifier.Driver(conf, topics, transport)

Base driver for Notifications

notify(ctxt, msg, priority, retry)

send a single notification with a specific priority

Parameters:
  • ctxt – current request context
  • msg (str) – message to be sent
  • priority (str) – priority of the message
  • retry (int) – connection retries configuration (used by the messaging driver): None or -1 means to retry forever. 0 means no retry is attempted. N means attempt at most N retries.
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.