summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2011-02-11 18:33:25 +0000
committerAlan Conway <aconway@apache.org>2011-02-11 18:33:25 +0000
commit83ed6b8379111fe5a2e317035764704f7896d011 (patch)
treeb8622b7180a66503cda79a7ac622eaa4eebeee85
parentdb2d21ecfc2376efc8b7c21c653f7623bb0e601e (diff)
downloadqpid-python-83ed6b8379111fe5a2e317035764704f7896d011.tar.gz
QPID-3049 - qpid-send --durable does not send durable messages.
The qpid-send test client with argument --durable only sends the first message as durable. Subsequent messages are not durable. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1069916 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--cpp/src/tests/qpid-send.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/cpp/src/tests/qpid-send.cpp b/cpp/src/tests/qpid-send.cpp
index 3824a870bf..6a7e7838ce 100644
--- a/cpp/src/tests/qpid-send.cpp
+++ b/cpp/src/tests/qpid-send.cpp
@@ -272,7 +272,11 @@ int main(int argc, char ** argv)
if (opts.priority) {
msg.setPriority(opts.priority);
}
- if (!opts.replyto.empty()) msg.setReplyTo(Address(opts.replyto));
+ if (!opts.replyto.empty()) {
+ if (opts.flowControl)
+ throw Exception("Can't use reply-to and flow-control together");
+ msg.setReplyTo(Address(opts.replyto));
+ }
if (!opts.userid.empty()) msg.setUserId(opts.userid);
if (!opts.correlationid.empty()) msg.setCorrelationId(opts.correlationid);
opts.setProperties(msg);
@@ -311,13 +315,17 @@ int main(int argc, char ** argv)
if (opts.timestamp)
msg.getProperties()[TS] = int64_t(
qpid::sys::Duration(qpid::sys::EPOCH, qpid::sys::now()));
- if (opts.flowControl && ((sent % opts.flowControl) == 0)) {
- msg.setReplyTo(flowControlAddress);
- ++flowSent;
+ if (opts.flowControl) {
+ if ((sent % opts.flowControl) == 0) {
+ msg.setReplyTo(flowControlAddress);
+ ++flowSent;
+ }
+ else
+ msg.setReplyTo(Address()); // Clear the reply address.
}
-
sender.send(msg);
reporter.message(msg);
+
if (opts.tx && (sent % opts.tx == 0)) {
if (opts.rollbackFrequency &&
(++txCount % opts.rollbackFrequency == 0))
@@ -337,7 +345,6 @@ int main(int argc, char ** argv)
int64_t delay = qpid::sys::Duration(qpid::sys::now(), waitTill);
if (delay > 0) qpid::sys::usleep(delay/qpid::sys::TIME_USEC);
}
- msg = Message(); // Clear out contents and properties for next iteration
}
for ( ; flowSent>0; --flowSent)
flowControlReceiver.get(Duration::SECOND);