summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker
diff options
context:
space:
mode:
authorCarl C. Trieloff <cctrieloff@apache.org>2008-11-03 21:06:22 +0000
committerCarl C. Trieloff <cctrieloff@apache.org>2008-11-03 21:06:22 +0000
commit472128f344562fc95a4b329a900eaefeeb9a3a47 (patch)
treef4291a168fe92b56c6458611de043a7f4d91f8b4 /cpp/src/qpid/broker
parent35be3fc7f95446e46d00ba37f37db97014b029b1 (diff)
downloadqpid-python-472128f344562fc95a4b329a900eaefeeb9a3a47.tar.gz
correction for Active-Active clustering, allowing late joining nodes in the cluster to sync counter values for sequenced messages
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@710157 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker')
-rw-r--r--cpp/src/qpid/broker/Exchange.cpp8
-rw-r--r--cpp/src/qpid/broker/Exchange.h2
2 files changed, 7 insertions, 3 deletions
diff --git a/cpp/src/qpid/broker/Exchange.cpp b/cpp/src/qpid/broker/Exchange.cpp
index fe388c2fe9..243d089ccb 100644
--- a/cpp/src/qpid/broker/Exchange.cpp
+++ b/cpp/src/qpid/broker/Exchange.cpp
@@ -152,7 +152,9 @@ Exchange::shared_ptr Exchange::decode(ExchangeRegistry& exchanges, Buffer& buffe
buffer.getShortString(type);
buffer.get(args);
- return exchanges.declare(name, type, durable, args).first;
+ Exchange::shared_ptr exch = exchanges.declare(name, type, durable, args).first;
+ exch->sequenceNo = buffer.getInt64();
+ return exch;
}
void Exchange::encode(Buffer& buffer) const
@@ -161,6 +163,7 @@ void Exchange::encode(Buffer& buffer) const
buffer.putOctet(durable);
buffer.putShortString(getType());
buffer.put(args);
+ buffer.putInt64(sequenceNo);
}
uint32_t Exchange::encodedSize() const
@@ -168,7 +171,8 @@ uint32_t Exchange::encodedSize() const
return name.size() + 1/*short string size*/
+ 1 /*durable*/
+ getType().size() + 1/*short string size*/
- + args.encodedSize();
+ + args.encodedSize()
+ + 8; /*int64 */
}
ManagementObject* Exchange::GetManagementObject (void) const
diff --git a/cpp/src/qpid/broker/Exchange.h b/cpp/src/qpid/broker/Exchange.h
index 50410b6e06..05b465d9df 100644
--- a/cpp/src/qpid/broker/Exchange.h
+++ b/cpp/src/qpid/broker/Exchange.h
@@ -50,7 +50,7 @@ private:
protected:
bool sequence;
mutable qpid::sys::Mutex sequenceLock;
- uint64_t sequenceNo;
+ int64_t sequenceNo;
bool ive;
boost::intrusive_ptr<Message> lastMsg;