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
This commit is contained in:
Gary Tully 2011-10-28 12:11:18 +00:00
parent 8340decaf3
commit 9ee2967220
2 changed files with 2 additions and 1 deletions

View File

@ -860,7 +860,7 @@ public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsC
registerSync(); registerSync();
MessageAck ack = new MessageAck(md, MessageAck.INDIVIDUAL_ACK_TYPE, 1); MessageAck ack = new MessageAck(md, MessageAck.INDIVIDUAL_ACK_TYPE, 1);
ack.setTransactionId(session.getTransactionContext().getTransactionId()); ack.setTransactionId(session.getTransactionContext().getTransactionId());
session.sendAck(ack); session.syncSendPacket(ack);
} }
private void afterMessageIsConsumed(MessageDispatch md, boolean messageExpired) throws JMSException { private void afterMessageIsConsumed(MessageDispatch md, boolean messageExpired) throws JMSException {

View File

@ -39,6 +39,7 @@ public class RedeliveryRestartTest extends BrokerRestartTestSupport {
super.configureBroker(broker); super.configureBroker(broker);
KahaDBPersistenceAdapter kahaDBPersistenceAdapter = (KahaDBPersistenceAdapter) broker.getPersistenceAdapter(); KahaDBPersistenceAdapter kahaDBPersistenceAdapter = (KahaDBPersistenceAdapter) broker.getPersistenceAdapter();
kahaDBPersistenceAdapter.setRewriteOnRedelivery(true); kahaDBPersistenceAdapter.setRewriteOnRedelivery(true);
kahaDBPersistenceAdapter.setCleanupInterval(500);
broker.addConnector("tcp://0.0.0.0:0"); broker.addConnector("tcp://0.0.0.0:0");
} }