From 35744c88d35ce1e533932b9e53c32d19d0b4a869 Mon Sep 17 00:00:00 2001 From: ozamiatin Date: Mon, 6 Feb 2017 12:02:15 +0200 Subject: [PATCH] [zmq] Properly analyse `use_dynamic_connections` option Option use_dynamic_connections has to be counted when direct publisher is being created along with proxy publisher (ZmqClientMixDirectPubSub). Change-Id: If0d5674d7015b164095a437464d3c780db892e19 Closes-Bug: #1662134 --- .../_drivers/zmq_driver/client/zmq_client.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/oslo_messaging/_drivers/zmq_driver/client/zmq_client.py b/oslo_messaging/_drivers/zmq_driver/client/zmq_client.py index 6665eef7f..a7efd065a 100644 --- a/oslo_messaging/_drivers/zmq_driver/client/zmq_client.py +++ b/oslo_messaging/_drivers/zmq_driver/client/zmq_client.py @@ -38,16 +38,20 @@ class ZmqClientMixDirectPubSub(zmq_client_base.ZmqClientBase): conf.oslo_messaging_zmq.use_pub_sub: raise WrongClientException() - publisher_direct = self._create_publisher_direct(conf, matchmaker) + publisher = self._create_publisher_direct_dynamic(conf, matchmaker) \ + if conf.oslo_messaging_zmq.use_dynamic_connections else \ + self._create_publisher_direct(conf, matchmaker) publisher_proxy = self._create_publisher_proxy_dynamic(conf, - matchmaker) + matchmaker) \ + if conf.oslo_messaging_zmq.use_dynamic_connections else \ + self._create_publisher_proxy(conf, matchmaker) super(ZmqClientMixDirectPubSub, self).__init__( conf, matchmaker, allowed_remote_exmods, publishers={ zmq_names.CAST_FANOUT_TYPE: publisher_proxy, zmq_names.NOTIFY_TYPE: publisher_proxy, - "default": publisher_direct + "default": publisher } )