summaryrefslogtreecommitdiff
path: root/cpp/src/qpid
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid')
-rw-r--r--cpp/src/qpid/broker/Queue.cpp10
-rw-r--r--cpp/src/qpid/broker/Queue.h1
-rw-r--r--cpp/src/qpid/client/QueueOptions.cpp5
-rw-r--r--cpp/src/qpid/client/QueueOptions.h3
4 files changed, 16 insertions, 3 deletions
diff --git a/cpp/src/qpid/broker/Queue.cpp b/cpp/src/qpid/broker/Queue.cpp
index 22659ec26c..4880dda553 100644
--- a/cpp/src/qpid/broker/Queue.cpp
+++ b/cpp/src/qpid/broker/Queue.cpp
@@ -61,6 +61,7 @@ const std::string qpidNoLocal("no-local");
const std::string qpidTraceIdentity("qpid.trace.id");
const std::string qpidTraceExclude("qpid.trace.exclude");
const std::string qpidLastValueQueue("qpid.last_value_queue");
+const std::string qpidLastValueQueueNoAcquire("qpid.last_value_queue_no_acquire");
const std::string qpidPersistLastNode("qpid.persist_last_node");
const std::string qpidVQMatchProperty("qpid.LVQ_key");
}
@@ -79,6 +80,7 @@ Queue::Queue(const string& _name, bool _autodelete,
exclusive(0),
noLocal(false),
lastValueQueue(false),
+ lastValueQueueNoAcquire(false),
persistLastNode(false),
inLastNodeFailure(false),
persistenceId(0),
@@ -213,7 +215,7 @@ bool Queue::acquire(const QueuedMessage& msg) {
|| (lastValueQueue && (i->position == msg.position) &&
msg.payload.get() == checkLvqReplace(*i).payload.get()) ) {
- clearLVQIndex(msg);
+ if (!lastValueQueueNoAcquire) clearLVQIndex(msg);
messages.erase(i);
QPID_LOG(debug, "Match found, acquire succeeded: " << i->position << " == " << msg.position);
return true;
@@ -673,6 +675,12 @@ void Queue::configure(const FieldTable& _settings)
lastValueQueue= _settings.get(qpidLastValueQueue);
if (lastValueQueue) QPID_LOG(debug, "Configured queue as Last Value Queue");
+ lastValueQueueNoAcquire = _settings.get(qpidLastValueQueueNoAcquire);
+ if (lastValueQueueNoAcquire){
+ QPID_LOG(debug, "Configured queue as Last Value Queue No Acquire");
+ lastValueQueue = lastValueQueueNoAcquire;
+ }
+
persistLastNode= _settings.get(qpidPersistLastNode);
if (persistLastNode) QPID_LOG(debug, "Configured queue to Persist data if cluster fails to one node");
diff --git a/cpp/src/qpid/broker/Queue.h b/cpp/src/qpid/broker/Queue.h
index c11c03a773..89cd3afc35 100644
--- a/cpp/src/qpid/broker/Queue.h
+++ b/cpp/src/qpid/broker/Queue.h
@@ -76,6 +76,7 @@ namespace qpid {
OwnershipToken* exclusive;
bool noLocal;
bool lastValueQueue;
+ bool lastValueQueueNoAcquire;
bool persistLastNode;
bool inLastNodeFailure;
std::string traceId;
diff --git a/cpp/src/qpid/client/QueueOptions.cpp b/cpp/src/qpid/client/QueueOptions.cpp
index 66cf8544f0..b360c1ab93 100644
--- a/cpp/src/qpid/client/QueueOptions.cpp
+++ b/cpp/src/qpid/client/QueueOptions.cpp
@@ -38,6 +38,7 @@ const std::string QueueOptions::strRING_STRICT("ring_strict");
const std::string QueueOptions::strLastValueQueue("qpid.last_value_queue");
const std::string QueueOptions::strPersistLastNode("qpid.persist_last_node");
const std::string QueueOptions::strLVQMatchProperty("qpid.LVQ_key");
+const std::string QueueOptions::strLastValueQueueNoAcquire("qpid.last_value_queue_no_acquire");
QueueOptions::~QueueOptions()
@@ -79,7 +80,9 @@ void QueueOptions::setOrdering(QueueOrderingPolicy op)
{
if (op == LVQ){
setInt(strLastValueQueue, 1);
- }else{
+ }else if (op == LVQ_NO_ACQUIRE){
+ setInt(strLastValueQueueNoAcquire, 1);
+ }else {
clearOrdering();
}
}
diff --git a/cpp/src/qpid/client/QueueOptions.h b/cpp/src/qpid/client/QueueOptions.h
index e9deb7ead8..c6cb071714 100644
--- a/cpp/src/qpid/client/QueueOptions.h
+++ b/cpp/src/qpid/client/QueueOptions.h
@@ -27,7 +27,7 @@ namespace qpid {
namespace client {
enum QueueSizePolicy {NONE, REJECT, FLOW_TO_DISK, RING, RING_STRICT};
-enum QueueOrderingPolicy {FIFO, LVQ};
+enum QueueOrderingPolicy {FIFO, LVQ, LVQ_NO_ACQUIRE};
/**
* A help class to set options on the Queue. Create a configured args while
@@ -94,6 +94,7 @@ class QueueOptions: public framing::FieldTable
static const std::string strLastValueQueue;
static const std::string strPersistLastNode;
static const std::string strLVQMatchProperty;
+ static const std::string strLastValueQueueNoAcquire;
};
}