Merge "Create a shared queue for QPID topic consumers"

This commit is contained in:
Jenkins 2013-12-06 17:33:11 +00:00 committed by Gerrit Code Review
commit ec06be3c6a

View File

@ -130,14 +130,13 @@ class ConsumerBase(object):
}, },
}, },
} }
if link_name:
addr_opts["link"]["name"] = link_name
addr_opts["node"]["x-declare"].update(node_opts) addr_opts["node"]["x-declare"].update(node_opts)
elif conf.qpid_topology_version == 2: elif conf.qpid_topology_version == 2:
addr_opts = { addr_opts = {
"link": { "link": {
"x-declare": { "x-declare": {
"auto-delete": True, "auto-delete": True,
"exclusive": False,
}, },
}, },
} }
@ -145,6 +144,8 @@ class ConsumerBase(object):
raise_invalid_topology_version() raise_invalid_topology_version()
addr_opts["link"]["x-declare"].update(link_opts) addr_opts["link"]["x-declare"].update(link_opts)
if link_name:
addr_opts["link"]["name"] = link_name
self.address = "%s ; %s" % (node_name, jsonutils.dumps(addr_opts)) self.address = "%s ; %s" % (node_name, jsonutils.dumps(addr_opts))
@ -219,14 +220,16 @@ class DirectConsumer(ConsumerBase):
if conf.qpid_topology_version == 1: if conf.qpid_topology_version == 1:
node_name = "%s/%s" % (msg_id, msg_id) node_name = "%s/%s" % (msg_id, msg_id)
node_opts = {"type": "direct"} node_opts = {"type": "direct"}
link_name = msg_id
elif conf.qpid_topology_version == 2: elif conf.qpid_topology_version == 2:
node_name = "amq.direct/%s" % msg_id node_name = "amq.direct/%s" % msg_id
node_opts = {} node_opts = {}
link_name = None
else: else:
raise_invalid_topology_version() raise_invalid_topology_version()
super(DirectConsumer, self).__init__(conf, session, callback, super(DirectConsumer, self).__init__(conf, session, callback,
node_name, node_opts, msg_id, node_name, node_opts, link_name,
link_opts) link_opts)