//If the delivery was obtained via a connection consumer we need to ack via that
//otherwise we just use this session
SessionDelegate sessionToUse = connectionConsumerSession != null ? connectionConsumerSession : sess;
sessionToUse.acknowledgeDelivery(delivery);
}
private void cancelDelivery(SessionDelegate sess, DeliveryInfo delivery) throws Exception
{
SessionDelegate connectionConsumerSession = delivery.getConnectionConsumerSession();