while (sentIter.hasNext()) {
TransactionWorkMessage msg = sentIter.next();
if (DEBUG) {
logger.log(Logger.DEBUG, getPrefix() + " convert sent msg "+msg);
}
DestinationUID duid = msg.getDestUID();
int type = (duid.isQueue() ? DestType.DEST_TYPE_QUEUE
: DestType.DEST_TYPE_TOPIC);
// make sure destination exists
// ( it may have been removed on load if it just contained
// messages in a transaction)
Destination dest = Destination.getDestination(duid.getName(),
type, true, true);
Packet message = msg.getMessage();
ConsumerUID[] iids = msg.getStoredInterests();
//if (iids != null)
if(false){
int[] states = new int[iids.length];
for (int i = 0; i < iids.length; i++) {
states[i] = 0;
}
fileStore.storeMessage(duid, message, iids, states, true);
} else {
fileStore.storeMessage(duid, message, true);
}
}
List<TransactionWorkMessageAck> consumedMsgs = work
.getMessageAcknowledgments();
Iterator<TransactionWorkMessageAck> consumedIter = consumedMsgs
.iterator();
while (consumedIter.hasNext()) {
TransactionWorkMessageAck msgAck = consumedIter.next();
if (DEBUG) {
logger.log(Logger.DEBUG, getPrefix() + " convert consumed msg "+msgAck);
}
DestinationUID duid = msgAck.getDestUID();
int type = (duid.isQueue() ? DestType.DEST_TYPE_QUEUE
: DestType.DEST_TYPE_TOPIC);
Destination dest = Destination.getDestination(duid.getName(),
type, true, true);
dest.load();
SysMessageID mid = msgAck.getSysMessageID();
ConsumerUID cid = msgAck.getConsumerID();
boolean sync = true;