I was wondering if there was a way to prevent a while loop from prematurely erroring out or terminating. I've thrown a try/catch in there and it seems to keep terminating. (As to the cause why it's terminating, I'm still debugging).
$stomp = $this->stomp;
if(isset($queue) && strlen($queue) > 0) {
error_log('Starting Monitor for: '.$queue);
$stomp->subscribe($queue);
while(true) {
$frame = $stomp->readFrame();
if ($frame != null) {
// Callback must be an array: array('Class','Method);
if(is_array($callback) && count($callback) == 2) {
try {
$body = $frame->body;
$callFunct = call_user_func_array($callback,array($body,$arguments));
$stomp->ack($frame);
} catch(StompException $e) {
$msg = 'Stomp Monitor readFrame() Callback Fail: '.$e->getMessage();
$this->context->reportError('STOMP',array('errorDetails'=>$msg));
}
} else {
error_log('Invalid Stomp Callback');
}
}
}
} `
Thanks, Steve