You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by cc...@apache.org on 2009/07/31 15:14:25 UTC

svn commit: r799598 - /qpid/trunk/qpid/cpp/src/qpid/replication/ReplicationExchange.cpp

Author: cctrieloff
Date: Fri Jul 31 13:14:25 2009
New Revision: 799598

URL: http://svn.apache.org/viewvc?rev=799598&view=rev
Log:
Some clean up, and better error check

Modified:
    qpid/trunk/qpid/cpp/src/qpid/replication/ReplicationExchange.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/replication/ReplicationExchange.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/replication/ReplicationExchange.cpp?rev=799598&r1=799597&r2=799598&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/replication/ReplicationExchange.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/replication/ReplicationExchange.cpp Fri Jul 31 13:14:25 2009
@@ -85,19 +85,21 @@
     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) {



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org