summaryrefslogtreecommitdiff
path: root/qpid/tools
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2014-04-07 21:22:55 +0000
committerAlan Conway <aconway@apache.org>2014-04-07 21:22:55 +0000
commita6f044f40d70b73c320cc909169e3518909365e2 (patch)
treea23df30ce4b52f1d23e55a0afa0e90c1fa20ffd6 /qpid/tools
parent8ea0f79d78edd0a0825547ecc618e3fa63a2b93f (diff)
downloadqpid-python-a6f044f40d70b73c320cc909169e3518909365e2.tar.gz
QPID-5560: HA tests do not use AMQP 1.0
The HA tests were using only AMQP 0-10. Modified the tests to use AMQP 1.0 if available (still use 0-10 if 1.0 is not available) Fixed bugs uncovered both in the tests and in the AMQP 1.0 implementation. Summary of changes: - brokertest.py: configurable support for of swig vs. native and amqp0-10 vs. 1.0 - default to swig+amqp1.0 if swig is available, native+amqp0-10 otherwise - qpidtoollibs/broker.py: enable use of swig client with BrokerAgent - Swig python client: - support for passing client_properties/properties. - expose AddressHelper pn_data read/write as PnData helper class - set sender/receiver capacity on creation - limited disposition support - rejected messages. - support for additional timeout parameters - expose messaging::Logger, allow log configuration to be set from python. - ha_tests.py: - bind, delete policies not supported by AMQP 1.0, switched to using BrokerAgent QMF. - pass protocol:amqp1.0 connection-option to c++ test clients (qpid-send, qpid-receive) - TX tests forsce use of 0-10 protocol (but still with Swig client if enabled.) - Broker fixes: - Queue::Settings::isTemporary was set in the 0-10 SessionAdapter, moved to Broker::createQueue. - broker::amqp::Session was always setting an exclusive owner in createQueue git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1585588 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/tools')
-rw-r--r--qpid/tools/src/py/qpidtoollibs/broker.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/qpid/tools/src/py/qpidtoollibs/broker.py b/qpid/tools/src/py/qpidtoollibs/broker.py
index e7be98c486..f6243bbba5 100644
--- a/qpid/tools/src/py/qpidtoollibs/broker.py
+++ b/qpid/tools/src/py/qpidtoollibs/broker.py
@@ -17,7 +17,7 @@
# under the License.
#
-from qpid.messaging import Message
+import sys
from qpidtoollibs.disp import TimeLong
try:
from uuid import uuid4
@@ -26,13 +26,16 @@ except ImportError:
class BrokerAgent(object):
"""
- Proxy for a manageable Qpid Broker - Invoke with an opened qpid.messaging.Connection.
+ Proxy for a manageable Qpid Broker - Invoke with an opened qpid.messaging.Connection
+ or qpid_messaging.Connection
"""
def __init__(self, conn):
+ # Use the Message class from the same module as conn which could be qpid.messaging
+ # or qpid_messaging
+ self.message_class = sys.modules[conn.__class__.__module__].Message
self.conn = conn
self.sess = self.conn.session()
- self.reply_to = "qmf.default.topic/direct.%s;{node:{type:topic}, link:{x-declare:{auto-delete:True,exclusive:True}}}" % \
- str(uuid4())
+ self.reply_to = "qmf.default.topic/direct.%s;{node:{type:topic}}" % str(uuid4())
self.reply_rx = self.sess.receiver(self.reply_to)
self.reply_rx.capacity = 10
self.tx = self.sess.sender("qmf.default.direct/broker")
@@ -55,8 +58,9 @@ class BrokerAgent(object):
'_method_name' : method,
'_arguments' : arguments}
- message = Message(content, reply_to=self.reply_to, correlation_id=correlator,
- properties=props, subject="broker")
+ message = self.message_class(
+ content, reply_to=self.reply_to, correlation_id=correlator,
+ properties=props, subject="broker")
self.tx.send(message)
response = self.reply_rx.fetch(timeout)
self.sess.acknowledge()
@@ -72,8 +76,9 @@ class BrokerAgent(object):
'x-amqp-0-10.app-id' : 'qmf2'}
correlator = str(self.next_correlator)
self.next_correlator += 1
- message = Message(content, reply_to=self.reply_to, correlation_id=correlator,
- properties=props, subject="broker")
+ message = self.message_class(
+ content, reply_to=self.reply_to, correlation_id=correlator,
+ properties=props, subject="broker")
self.tx.send(message)
return correlator
@@ -259,7 +264,7 @@ class BrokerAgent(object):
'options': options}
self._method('delete', args)
- def bind(self, exchange, queue, key, options={}, **kwargs):
+ def bind(self, exchange, queue, key="", options={}, **kwargs):
properties = options
for k,v in kwargs.items():
properties[k] = v