getConnection(); $con->subscribe('NonXAin'); $frame = $con->readFrame(); $msg = $frame->body; $con->ack($frame); $con->unsubscribe('NonXAin'); if($i % 2 != 0) throw new Problem(); $con2 = $this->getConnection(); $con2->send('NonXAout', $msg); unset($con); unset($con2); } catch(Problem $ex) { echo "Problem\r\n"; } } } } MQ::demo(new Bad()); ?>