From 74a9cbdc86580d256b6cd28ae57cd69213da6c44 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Wed, 13 Feb 2013 18:02:22 -0500 Subject: Add join_consumer_pool() to RPC connections blueprint move-listener-framework-oslo bug 1047015 bug 1111632 Ceilometer and Quantum use private methods of the RPC connection object to configure themselves to listen to a queue shared among a group of workers. This change adds a public method to the RPC connection to support this use case, without resorting to using private API calls. Change-Id: I3a89f1dfdcf8accca70cf305f7a31315bea093d8 Signed-off-by: Doug Hellmann --- openstack/common/rpc/common.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'openstack/common/rpc/common.py') diff --git a/openstack/common/rpc/common.py b/openstack/common/rpc/common.py index 357ee9d..55dad2d 100644 --- a/openstack/common/rpc/common.py +++ b/openstack/common/rpc/common.py @@ -196,6 +196,28 @@ class Connection(object): """ raise NotImplementedError() + def join_consumer_pool(self, callback, pool_name, topic, exchange_name): + """Register as a member of a group of consumers for a given topic from + the specified exchange. + + Exactly one member of a given pool will receive each message. + + A message will be delivered to multiple pools, if more than + one is created. + + :param callback: Callable to be invoked for each message. + :type callback: callable accepting one argument + :param pool_name: The name of the consumer pool. + :type pool_name: str + :param topic: The routing topic for desired messages. + :type topic: str + :param exchange_name: The name of the message exchange where + the client should attach. Defaults to + the configured exchange. + :type exchange_name: str + """ + raise NotImplementedError() + def consume_in_thread(self): """Spawn a thread to handle incoming messages. -- cgit