Ejemplo n.º 1
0
     continue;
 }
 $msg = null;
 $objQueue = array();
 try {
     $msg = $amqHandlerSubscriber->readFrame();
     if ($msg instanceof StompFrame && ($msg->command == "MESSAGE" || array_key_exists('MESSAGE', $msg->headers))) {
         $i++;
         _TimeStampMsg("--- (child {$my_pid}) : processing frame {$i}");
         $objQueue = json_decode($msg->body, true);
         //empty message what to do?? it should not be there, acknowledge and process the next one
         if (empty($objQueue['pid'])) {
             Utils::raiseJsonExceptionError();
             //                _TimeStampMsg( $msg );
             _TimeStampMsg("--- (child {$my_pid}) : found frame but no valid segment found for tm volume analysis: wait 2 seconds");
             $amqHandlerSubscriber->ack($msg);
             sleep(2);
             continue;
         }
     } else {
         //            _TimeStampMsg( "--- (child $my_pid) : no frame found. wait 5 second" );
         sleep(5);
         continue;
     }
 } catch (Exception $e) {
     _TimeStampMsg("*** \$this->amqHandler->readFrame() Failed. Continue Execution. ***");
     _TimeStampMsg($e->getMessage());
     //        _TimeStampMsg( $e->getTraceAsString() );
     continue;
     /* jump the ack */
 }