diff --git a/etc/trove/trove-conductor.conf.sample b/etc/trove/trove-conductor.conf.sample index 6249ed2ebd..d858bf254b 100644 --- a/etc/trove/trove-conductor.conf.sample +++ b/etc/trove/trove-conductor.conf.sample @@ -29,6 +29,34 @@ control_exchange = trove [database] connection = mysql+pymysql://root:e1a2c042c828d3566d0a@localhost/trove +[oslo_messaging_notifications] + +# +# From oslo.messaging +# + +# The Driver(s) to handle sending notifications. Possible +# values are messaging, messagingv2, routing, log, test, noop +# (multi valued) +# Deprecated group/name - [DEFAULT]/notification_driver +#driver = + +# A URL representing the messaging driver to use for +# notifications. If not set, we fall back to the same +# configuration used for RPC. (string value) +# Deprecated group/name - [DEFAULT]/notification_transport_url +#transport_url = + +# AMQP topic used for OpenStack notifications. (list value) +# Deprecated group/name - [rpc_notifier2]/topics +# Deprecated group/name - [DEFAULT]/notification_topics +#topics = notifications + +# The maximum number of attempts to re-send a notification +# message which failed to be delivered due to a recoverable +# error. 0 - No retry, -1 - indefinite (integer value) +#retry = -1 + [oslo_messaging_rabbit] # The RabbitMQ broker address where a single node is used. (string value) # Deprecated group/name - [DEFAULT]/rabbit_host diff --git a/etc/trove/trove-guestagent.conf.sample b/etc/trove/trove-guestagent.conf.sample index 9d52a465e7..756e9ef2c4 100644 --- a/etc/trove/trove-guestagent.conf.sample +++ b/etc/trove/trove-guestagent.conf.sample @@ -82,6 +82,34 @@ log_config_append = /etc/trove/trove-logging-guestagent.conf # If False doesn't trace SQL requests. #trace_sqlalchemy = True +[oslo_messaging_notifications] + +# +# From oslo.messaging +# + +# The Driver(s) to handle sending notifications. Possible +# values are messaging, messagingv2, routing, log, test, noop +# (multi valued) +# Deprecated group/name - [DEFAULT]/notification_driver +#driver = + +# A URL representing the messaging driver to use for +# notifications. If not set, we fall back to the same +# configuration used for RPC. (string value) +# Deprecated group/name - [DEFAULT]/notification_transport_url +#transport_url = + +# AMQP topic used for OpenStack notifications. (list value) +# Deprecated group/name - [rpc_notifier2]/topics +# Deprecated group/name - [DEFAULT]/notification_topics +#topics = notifications + +# The maximum number of attempts to re-send a notification +# message which failed to be delivered due to a recoverable +# error. 0 - No retry, -1 - indefinite (integer value) +#retry = -1 + [oslo_messaging_rabbit] # The RabbitMQ broker address where a single node is used. (string value) # Deprecated group/name - [DEFAULT]/rabbit_host diff --git a/etc/trove/trove-taskmanager.conf.sample b/etc/trove/trove-taskmanager.conf.sample index fca7b95c8b..b48b374854 100644 --- a/etc/trove/trove-taskmanager.conf.sample +++ b/etc/trove/trove-taskmanager.conf.sample @@ -180,6 +180,34 @@ idle_timeout = 3600 # If False doesn't trace SQL requests. #trace_sqlalchemy = True +[oslo_messaging_notifications] + +# +# From oslo.messaging +# + +# The Driver(s) to handle sending notifications. Possible +# values are messaging, messagingv2, routing, log, test, noop +# (multi valued) +# Deprecated group/name - [DEFAULT]/notification_driver +#driver = + +# A URL representing the messaging driver to use for +# notifications. If not set, we fall back to the same +# configuration used for RPC. (string value) +# Deprecated group/name - [DEFAULT]/notification_transport_url +#transport_url = + +# AMQP topic used for OpenStack notifications. (list value) +# Deprecated group/name - [rpc_notifier2]/topics +# Deprecated group/name - [DEFAULT]/notification_topics +#topics = notifications + +# The maximum number of attempts to re-send a notification +# message which failed to be delivered due to a recoverable +# error. 0 - No retry, -1 - indefinite (integer value) +#retry = -1 + [oslo_messaging_rabbit] # The RabbitMQ broker address where a single node is used. (string value) # Deprecated group/name - [DEFAULT]/rabbit_host diff --git a/etc/trove/trove.conf.sample b/etc/trove/trove.conf.sample index b0f91cd39b..011f5a6b12 100644 --- a/etc/trove/trove.conf.sample +++ b/etc/trove/trove.conf.sample @@ -177,6 +177,34 @@ idle_timeout = 3600 #optional: #ca_file = /path/to/ca_file +[oslo_messaging_notifications] + +# +# From oslo.messaging +# + +# The Driver(s) to handle sending notifications. Possible +# values are messaging, messagingv2, routing, log, test, noop +# (multi valued) +# Deprecated group/name - [DEFAULT]/notification_driver +#driver = + +# A URL representing the messaging driver to use for +# notifications. If not set, we fall back to the same +# configuration used for RPC. (string value) +# Deprecated group/name - [DEFAULT]/notification_transport_url +#transport_url = + +# AMQP topic used for OpenStack notifications. (list value) +# Deprecated group/name - [rpc_notifier2]/topics +# Deprecated group/name - [DEFAULT]/notification_topics +#topics = notifications + +# The maximum number of attempts to re-send a notification +# message which failed to be delivered due to a recoverable +# error. 0 - No retry, -1 - indefinite (integer value) +#retry = -1 + [oslo_messaging_rabbit] # The RabbitMQ broker address where a single node is used. (string value) # Deprecated group/name - [DEFAULT]/rabbit_host diff --git a/trove/rpc.py b/trove/rpc.py index c2e419edd6..81a9b2fbe4 100644 --- a/trove/rpc.py +++ b/trove/rpc.py @@ -39,6 +39,7 @@ from trove.common.rpc import serializer as sz CONF = cfg.CONF TRANSPORT = None +NOTIFICATION_TRANSPORT = None NOTIFIER = None ALLOWED_EXMODS = [ @@ -49,22 +50,29 @@ EXTRA_EXMODS = [] def init(conf): - global TRANSPORT, NOTIFIER + global TRANSPORT, NOTIFICATION_TRANSPORT, NOTIFIER exmods = get_allowed_exmods() TRANSPORT = messaging.get_rpc_transport(conf, allowed_remote_exmods=exmods) + NOTIFICATION_TRANSPORT = messaging.get_notification_transport( + conf, + allowed_remote_exmods=exmods) + serializer = sz.TroveRequestContextSerializer( 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):