ConsumerUID consumerID) throws BrokerException {
logger.log(Logger.DEBUG,
" trying to unroute prepared acknowledged message: destID = "
+ destID + " ackedMsgId=" + ackedSysMsgID);
Destination dest = null;
PacketReference ackedMessage = null;
if (destID != null) {
dest = Destination.getDestination(destID);
if (dest != null) {
dest.load();
ackedMessage = dest.getMessage(ackedSysMsgID);
if (ackedMessage == null) {
String msg = "Could not find packet for " + ackedSysMsgID
+ "in dest " + dest;
logger.log(Logger.WARNING, msg);
return;
}
} else {
// this could happen e.g. if empty auto dest has been destroyed
String msg = "Could not find destination for " + destID;
logger.log(Logger.WARNING, msg);
return;
}
} else {
// no destid stored for some reason so need to load all dests
logger.log(Logger.WARNING,
"No dest ID for acked message. Will need to load all dests "
+ ackedSysMsgID);
loadDestinations();
ackedMessage = Destination.get(ackedSysMsgID);
dest = ackedMessage.getDestination();
}
// need to unroute messages that have been consumed in a prepared
// transaction.
// they cannot be redelivered unless the transaction rolls back.
dest.unrouteLoadedTransactionAckMessage(ackedMessage, consumerID);
}