From 338f2196c07ea6ce2cd40941bca9ef11e95be2bf Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Tue, 3 Jul 2007 14:54:19 +0000 Subject: Fix (and test) for QPID-407. Messages are requeued at the head rather than the tail. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@552862 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/BrokerQueue.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'cpp/src/qpid/broker/BrokerQueue.h') diff --git a/cpp/src/qpid/broker/BrokerQueue.h b/cpp/src/qpid/broker/BrokerQueue.h index 35ffe2bc13..e39e58d35d 100644 --- a/cpp/src/qpid/broker/BrokerQueue.h +++ b/cpp/src/qpid/broker/BrokerQueue.h @@ -23,7 +23,7 @@ */ #include #include -#include +#include #include #include "qpid/framing/amqp_types.h" #include "ConnectionToken.h" @@ -57,7 +57,7 @@ namespace qpid { */ class Queue : public PersistableQueue{ typedef std::vector Consumers; - typedef std::queue Messages; + typedef std::deque Messages; const string name; const bool autodelete; @@ -108,6 +108,13 @@ namespace qpid { * one is available or stores it for later if not. */ void process(Message::shared_ptr& msg); + /** + * Returns a message to the in-memory queue (due to lack + * of acknowledegement from a receiver). If a consumer is + * available it will be dispatched immediately, else it + * will be returned to the front of the queue. + */ + void requeue(Message::shared_ptr& msg); /** * Used during recovery to add stored messages back to the queue */ -- cgit v1.2.1