summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/replication/ReplicationExchange.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2009-03-09 15:58:17 +0000
committerGordon Sim <gsim@apache.org>2009-03-09 15:58:17 +0000
commit1214783620f81f2b0b1e69c4c4df874d58cdf85b (patch)
tree354f0767a8b113278cb3d5f8208ee8769fe56bac /cpp/src/qpid/replication/ReplicationExchange.cpp
parent8f0e57d62c16d4723e6202127490ec12473e24d0 (diff)
downloadqpid-python-1214783620f81f2b0b1e69c4c4df874d58cdf85b.tar.gz
QPID-1721: Fixes for replication between clusters when new members are added
* suppress event generation during node catch up * ensure sequence counters used for duplicate detection are synchronised in both primary and dr clusters when new members join * connect queue with the event manager within queue registry rather than adapter as the latter path is not used for catchup git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@751719 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/replication/ReplicationExchange.cpp')
-rw-r--r--cpp/src/qpid/replication/ReplicationExchange.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/cpp/src/qpid/replication/ReplicationExchange.cpp b/cpp/src/qpid/replication/ReplicationExchange.cpp
index c35c6c2cd5..88c94ad7ba 100644
--- a/cpp/src/qpid/replication/ReplicationExchange.cpp
+++ b/cpp/src/qpid/replication/ReplicationExchange.cpp
@@ -34,11 +34,13 @@ using namespace qpid::broker;
using namespace qpid::framing;
using namespace qpid::replication::constants;
+const std::string SEQUENCE_VALUE("qpid.replication-event.sequence");
ReplicationExchange::ReplicationExchange(const std::string& name, bool durable,
const FieldTable& args,
QueueRegistry& qr,
Manageable* parent)
- : Exchange(name, durable, args, parent), queues(qr), init(false) {}
+ : Exchange(name, durable, args, parent), queues(qr), sequence(args.getAsInt64(SEQUENCE_VALUE)), init(false)
+ {}
std::string ReplicationExchange::getType() const { return typeName; }
@@ -135,6 +137,13 @@ bool ReplicationExchange::isBound(Queue::shared_ptr /*queue*/, const string* con
const std::string ReplicationExchange::typeName("replication");
+void ReplicationExchange::encode(Buffer& buffer) const
+{
+ args.setInt64(std::string(SEQUENCE_VALUE), sequence);
+ Exchange::encode(buffer);
+}
+
+
struct ReplicationExchangePlugin : Plugin
{
Broker* broker;