On 03/25/2013 10:16 PM, Rob Godfrey wrote:
  The implementation of persistence in
the C++ broker pretty much forced them to define ring queues.

Actually the introduction of ring queues was not driven by the store at all. It came from use cases where build up of queues beyond a given point was undesirable and where the older messages could be ignored in those cases. They effectively implement a policy of 'only keep the last N messages', whereas say using a TTL would be a policy of 'only keep messages for T seconds'.

 That's not
to say that there aren't non-persistent use cases for them.  The subtleties
are about what happens when consumption from the queue is not strictly
FIFO.  The C++ persistent queue implementation literally is a ring.  Thus
is you have non-FIFO consumption you can get "ring" overwriting even when
the number of unconsumed messages in the queue is less than the ring size.

The store will not overwrite, it will simply refuse to enqueue more if there is no more space (that may indeed be when there is only one message still enqueued, if it happens to be at the start of the 'ring'). The ring buffer used in the journal is entirely distinct from the ring queues in memory (which can for example evict out of order, based on priority).

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to