From b3b701ae79d88c6b74e023bf07af5a3e1bc59d11 Mon Sep 17 00:00:00 2001 From: Robert Gemmell Date: Thu, 13 Oct 2011 11:50:25 +0000 Subject: QPID-3546: update the highestDeliveryTag marker during failover to prevent the stale value being used to set the rollback mark on the first rollback after failover. This commit only fixes the 0-10 client path, as fixing this on the 0-8/9/9-1 path currently would cause undesirable interaction with the issue in QPID 3521. Applied patch from Oleksandr Rudyy and myself. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1182793 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/qpid/client/AMQSession.java | 33 ++++++++++++++++++---- .../org/apache/qpid/client/AMQSession_0_10.java | 11 ++++++++ .../org/apache/qpid/test/client/CancelTest.java | 2 +- 3 files changed, 40 insertions(+), 6 deletions(-) (limited to 'java') diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQSession.java b/java/client/src/main/java/org/apache/qpid/client/AMQSession.java index 44c4e8987a..d34290e007 100644 --- a/java/client/src/main/java/org/apache/qpid/client/AMQSession.java +++ b/java/client/src/main/java/org/apache/qpid/client/AMQSession.java @@ -308,7 +308,7 @@ public abstract class AMQSession + // messages sent by the brokers following the first rollback + // after failover + _highestDeliveryTag.set(-1); + super.resubscribe(); + } } diff --git a/java/systests/src/main/java/org/apache/qpid/test/client/CancelTest.java b/java/systests/src/main/java/org/apache/qpid/test/client/CancelTest.java index 13a9dd73b8..107c730a7e 100644 --- a/java/systests/src/main/java/org/apache/qpid/test/client/CancelTest.java +++ b/java/systests/src/main/java/org/apache/qpid/test/client/CancelTest.java @@ -94,7 +94,7 @@ public class CancelTest extends QpidBrokerTestCase browser.close(); MessageConsumer consumer = _clientSession.createConsumer(_queue); - assertNotNull( consumer.receive() ); + assertNotNull( consumer.receive(2000l) ); consumer.close(); } } -- cgit v1.2.1