public void start() throws JMSException {
transactionStore.start();
try {
transactionStore.recover(new RecoveryListener(){
public void recover(ActiveMQXid xid, ActiveMQMessage[] addedMessages, MessageAck[] aks) throws JMSException, XAException {
Transaction transaction = createXATransaction(null, xid);
for (int i = 0; i < addedMessages.length; i++) {
broker.sendMessage(null, addedMessages[i]);
}
for (int i = 0; i < aks.length; i++) {
broker.acknowledgeMessage(null, aks[i]);
}
transaction.prepare();
}
});
} catch (XAException e) {
throw JMSExceptionHelper.newJMSException("Recovery Failed: "+e.getMessage(), e);
}