Renamed argument for create_consumer[s]
Now that we don't have explicit dispatcher class to pass into RPC layer, and we pass a list of endpoints instead, fix names for corresponding arguments of the functions. blueprint oslo-messaging Change-Id: I84c6428574c155cdfaf535210b236c58604de268
This commit is contained in:
parent
8886c1a20d
commit
69afd8fc4b
@ -27,10 +27,10 @@ from neutron.openstack.common import timeutils
|
|||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def create_consumers(dispatcher, prefix, topic_details):
|
def create_consumers(endpoints, prefix, topic_details):
|
||||||
"""Create agent RPC consumers.
|
"""Create agent RPC consumers.
|
||||||
|
|
||||||
:param dispatcher: The dispatcher to process the incoming messages.
|
:param endpoints: The list of endpoints to process the incoming messages.
|
||||||
:param prefix: Common prefix for the plugin/agent message queues.
|
:param prefix: Common prefix for the plugin/agent message queues.
|
||||||
:param topic_details: A list of topics. Each topic has a name, an
|
:param topic_details: A list of topics. Each topic has a name, an
|
||||||
operation, and an optional host param keying the
|
operation, and an optional host param keying the
|
||||||
@ -45,11 +45,11 @@ def create_consumers(dispatcher, prefix, topic_details):
|
|||||||
itertools.chain(details, [None]), 3)
|
itertools.chain(details, [None]), 3)
|
||||||
|
|
||||||
topic_name = topics.get_topic_name(prefix, topic, operation)
|
topic_name = topics.get_topic_name(prefix, topic, operation)
|
||||||
connection.create_consumer(topic_name, dispatcher, fanout=True)
|
connection.create_consumer(topic_name, endpoints, fanout=True)
|
||||||
if node_name:
|
if node_name:
|
||||||
node_topic_name = '%s.%s' % (topic_name, node_name)
|
node_topic_name = '%s.%s' % (topic_name, node_name)
|
||||||
connection.create_consumer(node_topic_name,
|
connection.create_consumer(node_topic_name,
|
||||||
dispatcher,
|
endpoints,
|
||||||
fanout=False)
|
fanout=False)
|
||||||
connection.consume_in_threads()
|
connection.consume_in_threads()
|
||||||
return connection
|
return connection
|
||||||
|
@ -142,10 +142,10 @@ class Connection(object):
|
|||||||
super(Connection, self).__init__()
|
super(Connection, self).__init__()
|
||||||
self.servers = []
|
self.servers = []
|
||||||
|
|
||||||
def create_consumer(self, topic, proxy, fanout=False):
|
def create_consumer(self, topic, endpoints, fanout=False):
|
||||||
target = messaging.Target(
|
target = messaging.Target(
|
||||||
topic=topic, server=cfg.CONF.host, fanout=fanout)
|
topic=topic, server=cfg.CONF.host, fanout=fanout)
|
||||||
server = n_rpc.get_server(target, proxy)
|
server = n_rpc.get_server(target, endpoints)
|
||||||
self.servers.append(server)
|
self.servers.append(server)
|
||||||
|
|
||||||
def consume_in_threads(self):
|
def consume_in_threads(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user