diff options
author | Alan Conway <aconway@apache.org> | 2008-11-12 17:15:20 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-11-12 17:15:20 +0000 |
commit | c99d4d45ead8020517838b99e2106887701b17d7 (patch) | |
tree | 66559a3df444de8a4cb52ffbead0123dd2325d69 /cpp/src/qpid/broker/Exchange.cpp | |
parent | 1a18c1798833e7201177e786afa0d05412c4f53b (diff) | |
download | qpid-python-c99d4d45ead8020517838b99e2106887701b17d7.tar.gz |
Cluster replicates queues/exchanges with same encode/decode functions as the store.
Removed un-necessary heap allocation in QPID_LOG statements.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@713425 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Exchange.cpp')
-rw-r--r-- | cpp/src/qpid/broker/Exchange.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/cpp/src/qpid/broker/Exchange.cpp b/cpp/src/qpid/broker/Exchange.cpp index 6a3fa88ff0..34673bdab3 100644 --- a/cpp/src/qpid/broker/Exchange.cpp +++ b/cpp/src/qpid/broker/Exchange.cpp @@ -40,6 +40,7 @@ namespace _qmf = qmf::org::apache::qpid::broker; namespace { const std::string qpidMsgSequence("qpid.msg_sequence"); +const std::string qpidSequenceCounter("qpid.sequence_counter"); const std::string qpidIVE("qpid.ive"); const std::string qpidFedOp("qpid.fed.op"); const std::string qpidFedTags("qpid.fed.tags"); @@ -119,7 +120,10 @@ Exchange::Exchange(const string& _name, bool _durable, const qpid::framing::Fiel } sequence = _args.get(qpidMsgSequence); - if (sequence) QPID_LOG(debug, "Configured exchange "+ _name +" with Msg sequencing"); + if (sequence) { + QPID_LOG(debug, "Configured exchange "+ _name +" with Msg sequencing"); + args.setInt64(std::string(qpidSequenceCounter), sequenceNo); + } ive = _args.get(qpidIVE); if (ive) QPID_LOG(debug, "Configured exchange "+ _name +" with Initial Value"); @@ -153,7 +157,7 @@ Exchange::shared_ptr Exchange::decode(ExchangeRegistry& exchanges, Buffer& buffe buffer.get(args); Exchange::shared_ptr exch = exchanges.declare(name, type, durable, args).first; - exch->sequenceNo = args.getAsInt64("qpid.sequence_counter"); + exch->sequenceNo = args.getAsInt64(qpidSequenceCounter); return exch; } @@ -162,7 +166,8 @@ void Exchange::encode(Buffer& buffer) const buffer.putShortString(name); buffer.putOctet(durable); buffer.putShortString(getType()); - if (sequenceNo) args.setInt64(std::string("qpid.sequence_counter"),sequenceNo); + if (args.isSet(qpidSequenceCounter)) + args.setInt64(std::string(qpidSequenceCounter),sequenceNo); buffer.put(args); } |