}
}
public void individualAcknowledge(final long consumerID, final long messageID) throws Exception
{
ServerConsumer consumer = consumers.get(consumerID);
if (this.xa && tx == null)
{
throw new HornetQXAException(XAException.XAER_PROTO, "Invalid transaction state");
}
if (tx != null && tx.getState() == State.ROLLEDBACK)
{
// JBPAPP-8845 - if we let stuff to be acked on a rolled back TX, we will just
// have these messages to be stuck on the limbo until the server is restarted
// The tx has already timed out, so we need to ack and rollback immediately
Transaction newTX = newTransaction();
consumer.individualAcknowledge(autoCommitAcks, tx, messageID);
newTX.rollback();
}
else
{
consumer.individualAcknowledge(autoCommitAcks, tx, messageID);
}
}