summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorCarl C. Trieloff <cctrieloff@apache.org>2009-07-31 13:14:25 +0000
committerCarl C. Trieloff <cctrieloff@apache.org>2009-07-31 13:14:25 +0000
commitca88c98484377d46ca4d4c23a6f0dd2fbe291111 (patch)
tree14712133b74f17136efa10d42231b1da6a41916a /qpid/cpp/src
parentda9b80c308048d38e17811eba297b86f21eed836 (diff)
downloadqpid-python-ca88c98484377d46ca4d4c23a6f0dd2fbe291111.tar.gz
Some clean up, and better error check
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@799598 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/replication/ReplicationExchange.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/qpid/cpp/src/qpid/replication/ReplicationExchange.cpp b/qpid/cpp/src/qpid/replication/ReplicationExchange.cpp
index 053335e6ad..b5911bb71e 100644
--- a/qpid/cpp/src/qpid/replication/ReplicationExchange.cpp
+++ b/qpid/cpp/src/qpid/replication/ReplicationExchange.cpp
@@ -85,19 +85,21 @@ void ReplicationExchange::handleEnqueueEvent(const FieldTable* args, Deliverable
if (queue) {
SequenceNumber seqno1(args->getAsInt(QUEUE_MESSAGE_POSITION));
-
- if (queue->getPosition() > seqno1) // test queue.pos < seqnumber
+
+ // note that queue will ++ before enqueue.
+ if (queue->getPosition() > --seqno1) // test queue.pos < seqnumber
{
QPID_LOG(error, "Cannot enqueue replicated message. Destination Queue " << queueName << " ahead of source queue");
mgmtExchange->inc_msgDrops();
mgmtExchange->inc_byteDrops(msg.contentSize());
} else {
- queue->setPosition(--seqno1); // note that queue will ++ before enqueue.
+ queue->setPosition(seqno1);
FieldTable& headers = msg.getMessage().getProperties<MessageProperties>()->getApplicationHeaders();
headers.erase(REPLICATION_TARGET_QUEUE);
headers.erase(REPLICATION_EVENT_SEQNO);
headers.erase(REPLICATION_EVENT_TYPE);
+ headers.erase(QUEUE_MESSAGE_POSITION);
msg.deliverTo(queue);
QPID_LOG(debug, "Enqueued replicated message onto " << queueName);
if (mgmtExchange != 0) {