}
else {
transaction = transactionManager.getLocalTransaction(transactionId);
}
transaction.addPostCommitTask(new MessageAckTransactionTask(client, ack));
transaction.addPostRollbackTask(new RedeliverMessageTransactionTask(client, ack));
// we need to tell the dispatcher that we can now accept another message
// even though we don't really ack the message until the commit
// this is because if we have a prefetch value of 1, we can never consume 2 messages
// in a transaction, since the ack for the first message never arrives until the commit