[jboss-cvs] JBoss Messaging SVN: r3374 - in branches/Branch_Stable/src/main/org/jboss: messaging/util and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Nov 28 05:18:07 EST 2007
Author: timfox
Date: 2007-11-28 05:18:06 -0500 (Wed, 28 Nov 2007)
New Revision: 3374
Modified:
branches/Branch_Stable/src/main/org/jboss/jms/client/state/SessionState.java
branches/Branch_Stable/src/main/org/jboss/messaging/util/Reorderer.java
Log:
http://jira.jboss.org/jira/browse/JBMESSAGING-1166
Modified: branches/Branch_Stable/src/main/org/jboss/jms/client/state/SessionState.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/jms/client/state/SessionState.java 2007-11-28 10:16:53 UTC (rev 3373)
+++ branches/Branch_Stable/src/main/org/jboss/jms/client/state/SessionState.java 2007-11-28 10:18:06 UTC (rev 3374)
@@ -339,6 +339,7 @@
}
List recoveryInfos = new ArrayList();
+ long maxDeliveryID = 0;
if (!ackInfos.isEmpty())
{
for (Iterator i = ackInfos.iterator(); i.hasNext(); )
@@ -349,7 +350,8 @@
del.getMessageProxy().getMessage().getMessageID(),
del.getQueueName());
- recoveryInfos.add(recInfo);
+ recoveryInfos.add(recInfo);
+ maxDeliveryID = Math.max(maxDeliveryID, del.getMessageProxy().getDeliveryId());
}
}
@@ -362,13 +364,13 @@
//like remove from recovery Area refs corresponding to messages in client consumer buffers
newDelegate.recoverDeliveries(recoveryInfos, oldSessionID);
+
+ reorderer.reset(maxDeliveryID + 1);
}
else
{
- //The delivery id will get reset so we must reset on the re-orderer too
-
- reorderer.reset();
- }
+ reorderer.reset(maxDeliveryID);
+ }
}
// Public ---------------------------------------------------------------------------------------
Modified: branches/Branch_Stable/src/main/org/jboss/messaging/util/Reorderer.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/messaging/util/Reorderer.java 2007-11-28 10:16:53 UTC (rev 3373)
+++ branches/Branch_Stable/src/main/org/jboss/messaging/util/Reorderer.java 2007-11-28 10:18:06 UTC (rev 3374)
@@ -43,11 +43,11 @@
private Map<Long, Object> heldBack = new HashMap<Long, Object>();
- public synchronized void reset()
+ public synchronized void reset(long expectedSequence)
{
heldBack.clear();
- expectedSequence = 0;
+ this.expectedSequence = expectedSequence;
}
public synchronized void handle(Object object, long thisSequence) throws Exception
@@ -57,7 +57,7 @@
//This is a workaround to allow us to use one way messages for np messages for performance
//reasons
-
+
if (thisSequence == expectedSequence)
{
do
More information about the jboss-cvs-commits
mailing list