if (session.isBusy() && !stopped) {
// cool, we have something to do
Packet p = new Packet();
// retrieve the next packet and its ConsumerUID
ConsumerUID uid = session.fillNextPacket(p);
if (uid == null) {
// weird, something went wrong, try again
continue;
}
// Get the consumer object
Consumer con = (Consumer)consumers.get(uid);
try {
JMSAck ack = null;
// call the deliver method
ack = con.deliver(p);
if (ack != null) {
long transactionId = ack.getTransactionId(),
consumerId = ack.getConsumerId();
SysMessageID sysMsgId = ack.getSysMessageID();
TransactionUID txnUID = null;
ConsumerUID conUID = null;
if (transactionId != 0) {
txnUID = new TransactionUID(transactionId);
}
if (consumerId != 0) {
conUID = new ConsumerUID(consumerId);
}
IMQConnection cxn = parent.checkConnectionId(ack.getConnectionId(), "Listener Thread");
SysMessageID ids[] = new SysMessageID[1];
//ids[0] = sysMsgId;
//ids[0] = ((Packet)p).getSysMessageID();
ids[0] = sysMsgId;
ConsumerUID cids[] = new ConsumerUID[1];
cids[0] = conUID;
Globals.getProtocol().acknowledge(cxn, txnUID, false, AckHandler.ACKNOWLEDGE_REQUEST, null, null, 0, ids, cids);
}
} catch (Exception ex) {
// I have no idea what the exception might mean so just