From 9ee296722007049d18b56c77385a58cef72a5a98 Mon Sep 17 00:00:00 2001 From: Gary Tully Date: Fri, 28 Oct 2011 12:11:18 +0000 Subject: [PATCH] https://issues.apache.org/jira/browse/AMQ-3519 - fix intermittent failure of org.apache.activemq.broker.RedeliveryRestartTest. inddividual ack marking delivery must be sent sync git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1190265 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/activemq/ActiveMQMessageConsumer.java | 2 +- .../java/org/apache/activemq/broker/RedeliveryRestartTest.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java b/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java index dc0d0fb3c2..8568ab6768 100755 --- a/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java +++ b/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java @@ -860,7 +860,7 @@ public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsC registerSync(); MessageAck ack = new MessageAck(md, MessageAck.INDIVIDUAL_ACK_TYPE, 1); ack.setTransactionId(session.getTransactionContext().getTransactionId()); - session.sendAck(ack); + session.syncSendPacket(ack); } private void afterMessageIsConsumed(MessageDispatch md, boolean messageExpired) throws JMSException { diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/RedeliveryRestartTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/RedeliveryRestartTest.java index 0834d38eba..a1486a04c0 100644 --- a/activemq-core/src/test/java/org/apache/activemq/broker/RedeliveryRestartTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/broker/RedeliveryRestartTest.java @@ -39,6 +39,7 @@ public class RedeliveryRestartTest extends BrokerRestartTestSupport { super.configureBroker(broker); KahaDBPersistenceAdapter kahaDBPersistenceAdapter = (KahaDBPersistenceAdapter) broker.getPersistenceAdapter(); kahaDBPersistenceAdapter.setRewriteOnRedelivery(true); + kahaDBPersistenceAdapter.setCleanupInterval(500); broker.addConnector("tcp://0.0.0.0:0"); }