Skip to content

Commit

Permalink
Sync rpc fix from oslo-incubator
Browse files Browse the repository at this point in the history
Sync the following fixes from oslo-incubator:

e227c0e Properly reconnect subscribing clients when QPID broker restarts
ef406a2 Create a shared queue for QPID topic consumers

Change-Id: I286edf6bc4a677aa61f60da785802c19878c79c7
Closes-bug: #1251757
Closes-bug: #1257293
  • Loading branch information
flaper87 committed Dec 6, 2013
1 parent a607a2e commit 7afd0f4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions neutron/openstack/common/rpc/impl_qpid.py
Expand Up @@ -18,7 +18,6 @@
import functools
import itertools
import time
import uuid

import eventlet
import greenlet
Expand Down Expand Up @@ -123,7 +122,6 @@ def __init__(self, conf, session, callback, node_name, node_opts,
},
},
"link": {
"name": link_name,
"durable": True,
"x-declare": {
"durable": False,
Expand All @@ -138,13 +136,16 @@ def __init__(self, conf, session, callback, node_name, node_opts,
"link": {
"x-declare": {
"auto-delete": True,
"exclusive": False,
},
},
}
else:
raise_invalid_topology_version()

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))

Expand Down Expand Up @@ -208,14 +209,16 @@ def __init__(self, conf, session, msg_id, callback):
if conf.qpid_topology_version == 1:
node_name = "%s/%s" % (msg_id, msg_id)
node_opts = {"type": "direct"}
link_name = msg_id
elif conf.qpid_topology_version == 2:
node_name = "amq.direct/%s" % msg_id
node_opts = {}
link_name = None
else:
raise_invalid_topology_version()

super(DirectConsumer, self).__init__(conf, session, callback,
node_name, node_opts, msg_id,
node_name, node_opts, link_name,
link_opts)


Expand Down Expand Up @@ -266,16 +269,14 @@ def __init__(self, conf, session, topic, callback):
if conf.qpid_topology_version == 1:
node_name = "%s_fanout" % topic
node_opts = {"durable": False, "type": "fanout"}
link_name = "%s_fanout_%s" % (topic, uuid.uuid4().hex)
elif conf.qpid_topology_version == 2:
node_name = "amq.topic/fanout/%s" % topic
node_opts = {}
link_name = ""
else:
raise_invalid_topology_version()

super(FanoutConsumer, self).__init__(conf, session, callback,
node_name, node_opts, link_name,
node_name, node_opts, None,
link_opts)


Expand Down

0 comments on commit 7afd0f4

Please sign in to comment.