summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-07-03 16:09:23 +0000
committerGerrit Code Review <review@openstack.org>2018-07-03 16:09:23 +0000
commit816c99235fd64bdaa80dc8d8c54cffb81ba7f90e (patch)
treef7bf745168dd84a907255466b7ebb6d233d633de
parent16162a30c07587b147092844bca9c443f83042f1 (diff)
parent5fdef82a30bf36fbbe2073163e201fedb4849d1b (diff)
downloaddesignate-816c99235fd64bdaa80dc8d8c54cffb81ba7f90e.tar.gz
Merge "Use listener pools in designate-sink"
-rw-r--r--designate/rpc.py3
-rw-r--r--designate/sink/__init__.py5
-rw-r--r--designate/sink/service.py4
-rw-r--r--releasenotes/notes/pool-listener-6689ffa50345ba6e.yaml15
4 files changed, 25 insertions, 2 deletions
diff --git a/designate/rpc.py b/designate/rpc.py
index e1ed5d8e..8702f442 100644
--- a/designate/rpc.py
+++ b/designate/rpc.py
@@ -198,7 +198,7 @@ def get_server(target, endpoints, serializer=None):
TRANSPORT, target, dispatcher, 'eventlet')
-def get_listener(targets, endpoints, serializer=None):
+def get_listener(targets, endpoints, serializer=None, pool=None):
assert TRANSPORT is not None
if serializer is None:
serializer = JsonPayloadSerializer()
@@ -206,6 +206,7 @@ def get_listener(targets, endpoints, serializer=None):
targets,
endpoints,
executor='eventlet',
+ pool=pool,
serializer=serializer)
diff --git a/designate/sink/__init__.py b/designate/sink/__init__.py
index adf4c2c5..c6557cfc 100644
--- a/designate/sink/__init__.py
+++ b/designate/sink/__init__.py
@@ -26,6 +26,11 @@ OPTS = [
help='Number of sink greenthreads to spawn'),
cfg.ListOpt('enabled-notification-handlers', default=[],
help='Enabled Notification Handlers'),
+ cfg.StrOpt('listener-pool-name',
+ help='pool name to use for oslo.messaging '
+ 'notification listener. '
+ 'Note that listener pooling is not supported '
+ 'by all oslo.messaging drivers.'),
]
diff --git a/designate/sink/service.py b/designate/sink/service.py
index d8341c84..90db96db 100644
--- a/designate/sink/service.py
+++ b/designate/sink/service.py
@@ -68,7 +68,9 @@ class Service(service.Service):
# TODO(ekarlso): Change this is to endpoint objects rather then
# ourselves?
- self._server = rpc.get_listener(targets, [self])
+ self._server = rpc.get_listener(
+ targets, [self],
+ pool=cfg.CONF['service:sink'].listener_pool_name)
if len(targets) > 0:
self._server.start()
diff --git a/releasenotes/notes/pool-listener-6689ffa50345ba6e.yaml b/releasenotes/notes/pool-listener-6689ffa50345ba6e.yaml
new file mode 100644
index 00000000..56f9216e
--- /dev/null
+++ b/releasenotes/notes/pool-listener-6689ffa50345ba6e.yaml
@@ -0,0 +1,15 @@
+---
+features:
+ - |
+ Designate-Sink service now supports notification listener pooling
+ for those oslo.messaging drivers that support this feature
+ (currently those are ``rabbit``/``kombu`` and ``kafka``).
+ `Listener pools <https://docs.openstack.org/oslo.messaging/latest/reference/notification_listener.html>`_
+ is an alternative to specifying several topics for notification consumers
+ in configuration of service that emits notifications.
+
+ To enable listener pooling, set the option
+ ``[service:sink]listener_pool_name`` to some string value, that must be the
+ same for all designate-sink service instances.
+ Default value of this option (``None``) disables notification listener
+ pooling.