From qpid-commits-return-3649-apmail-incubator-qpid-commits-archive=incubator.apache.org@incubator.apache.org Mon Oct 01 20:14:07 2007 Return-Path: Delivered-To: apmail-incubator-qpid-commits-archive@locus.apache.org Received: (qmail 49677 invoked from network); 1 Oct 2007 20:14:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Oct 2007 20:14:06 -0000 Received: (qmail 25709 invoked by uid 500); 1 Oct 2007 20:13:56 -0000 Delivered-To: apmail-incubator-qpid-commits-archive@incubator.apache.org Received: (qmail 25690 invoked by uid 500); 1 Oct 2007 20:13:56 -0000 Mailing-List: contact qpid-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: qpid-dev@incubator.apache.org Delivered-To: mailing list qpid-commits@incubator.apache.org Received: (qmail 25681 invoked by uid 99); 1 Oct 2007 20:13:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Oct 2007 13:13:56 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Oct 2007 20:14:06 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 19B0F1A9832; Mon, 1 Oct 2007 13:13:46 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r581057 - /incubator/qpid/trunk/qpid/cpp/src/tests/perftest.cpp Date: Mon, 01 Oct 2007 20:13:45 -0000 To: qpid-commits@incubator.apache.org From: cctrieloff@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071001201346.19B0F1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: cctrieloff Date: Mon Oct 1 13:13:45 2007 New Revision: 581057 URL: http://svn.apache.org/viewvc?rev=581057&view=rev Log: - add option to create durable messages. Modified: incubator/qpid/trunk/qpid/cpp/src/tests/perftest.cpp Modified: incubator/qpid/trunk/qpid/cpp/src/tests/perftest.cpp URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/perftest.cpp?rev=581057&r1=581056&r2=581057&view=diff ============================================================================== --- incubator/qpid/trunk/qpid/cpp/src/tests/perftest.cpp (original) +++ incubator/qpid/trunk/qpid/cpp/src/tests/perftest.cpp Mon Oct 1 13:13:45 2007 @@ -26,6 +26,7 @@ #include "qpid/client/Queue.h" #include "qpid/client/Connection.h" #include "qpid/client/MessageListener.h" +#include #include "qpid/QpidError.h" #include "qpid/sys/Monitor.h" #include "qpid/sys/Time.h" @@ -47,12 +48,14 @@ bool listen; bool publish; int count; + bool durable; Opts() : listen(false), publish(false), count(500000) { addOptions() ("listen", optValue(listen), "Consume messages.") ("publish", optValue(publish), "Produce messages.") - ("count", optValue(count, "N"), "Messages to send/receive."); + ("count", optValue(count, "N"), "Messages to send/receive.") + ("durable", optValue(durable, "N"), "Publish messages as durable."); } }; @@ -195,6 +198,10 @@ if (::clock_gettime(CLOCK_REALTIME, &startTime)) throw Exception(QPID_MSG("clock_gettime failed: " << strError(errno))); + bool durable = opts.durable; + if (durable) + msg.getDeliveryProperties().setDeliveryMode(framing::PERSISTENT); + for (int i=0; i