> On May 9, 2013, 8:12 a.m., Gordon Sim wrote:
> > /trunk/qpid/cpp/src/qpid/broker/Queue.cpp, line 743
> > <https://reviews.apache.org/r/11009/diff/2/?file=289011#file289011line743>
> >
> > Note: Alan is reporting significant impact to performance from the
> > addAnnotation() method. This is just fyi really as there is as yet no
> > alternative.
$ qpid-cpp-benchmark --repeat 5 --create-option
"node:{x-declare:{arguments:{'qpid.queue_msg_sequence':1}}}"
send-tp recv-tp l-min l-max l-avg total-tp
30720 30671 0.32 44.03 18.28 30064
31778 31729 0.22 54.36 16.77 31068
31664 31637 0.39 69.50 22.11 31014
31303 31301 0.33 43.97 17.32 30737
31577 31403 0.33 37.73 15.59 30785
$ qpid-cpp-benchmark --repeat 5
send-tp recv-tp l-min l-max l-avg total-tp
47138 47120 0.13 29.02 9.35 45870
46299 46156 0.13 25.24 8.33 44803
45910 45793 0.13 53.53 10.81 45300
46607 46388 0.16 29.70 9.21 45245
46905 46766 0.16 31.43 9.62 45776
- Gordon
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/11009/#review20370
-----------------------------------------------------------
On May 8, 2013, 7:30 p.m., Ernie Allen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/11009/
> -----------------------------------------------------------
>
> (Updated May 8, 2013, 7:30 p.m.)
>
>
> Review request for qpid, Alan Conway, Gordon Sim, and Justin Ross.
>
>
> Description
> -------
>
> The primary purpose of this is to detect when a ring queue overwrites
> messages. The client can examine the sequence number and look for gaps which
> indicate that messages have been dropped.
>
> To enable, create the queue with the qpid.queue_msg_sequence arg:
> std::string addr("my-queue;"
> " {create:sender, delete:always,"
> " node: {type: queue, x-declare: {arguments:"
> " {qpid.queue_msg_sequence:1, qpid.policy_type:ring,
> qpid.max_count:4}}}}");
>
> Sender sender = session.createSender(addr);
> This enables sequencing when a message is enqueued. Sequence numbers start at
> 1 and are unsigned 64 bit numbers.
> The exchange level sequencing uses "qpid.msg_sequence" as the key.
>
> *** Question *** Should queues use the same key to enable sequencing as
> exchanges? "qpid.msg_sequence" The page
> https://cwiki.apache.org/qpid/qpid-extensions-to-amqp.html indicates that
> qpid.msg_sequence is supported when declaring a queue, but that key was never
> supported for queues.
>
>
> To get the sequence number:
> uint64_t seqNo;
> seqNo = response.getProperties()["qpid.queue_msg_sequence"];
>
> *** Note ***
> I added a uint64 to the queue class. There is an existing message sequence
> number for queues. It is a SequenceNumber class.
> However, this is a 32 bit number. I was leery of changing that to a 64 bit
> number since it is used throughout the broker and not just as a msg counter.
> I'm assuming a 32 bit number is not sufficient in this case since "wrapping
> around" to zero would complicate the logic of detecting overwritten messages.
>
> There is a public class variable in Queue.h named std::string seqNoKey; It is
> unused. My guess is that it was intended for use with the SequenceNumber
> class. Can it be removed?
>
> This does not address the issue of persisting the message sequence after a
> broker restart. This will be a future issue.
>
> Before committing this, C++ and python tests would need to be added.
>
>
> This addresses bug QPID-4591.
> https://issues.apache.org/jira/browse/QPID-4591
>
>
> Diffs
> -----
>
> /trunk/qpid/cpp/src/qpid/broker/Queue.h 1478851
> /trunk/qpid/cpp/src/qpid/broker/Queue.cpp 1478851
> /trunk/qpid/cpp/src/qpid/broker/QueueSettings.h 1478851
> /trunk/qpid/cpp/src/qpid/broker/QueueSettings.cpp 1478851
>
> Diff: https://reviews.apache.org/r/11009/diff/
>
>
> Testing
> -------
>
> See attached testring.cpp and mm (make script)
> They create a ring queue that holds 4 messages with qpid.queue_msg_sequence,
> sends enough messages to overflow the queue, and then retrieves the messages.
> It outputs the message sequence numbers.
>
>
> Thanks,
>
> Ernie Allen
>
>