Quantcast
Viewing all articles
Browse latest Browse all 5648

Null body when consuming from php application

I have a Zend 1 PHP command line application running under Windows with the
php stomp extension <http://pecl.php.net/package/stomp> . It reads messages
from ActiveMQ 5.6.0 (which runs on Linux Ubuntu ) with the PHP stomp api
<http://www.php.net/manual/fr/book.stomp.php> . Messages are sent by a PHP
Zend2 application on Linux Ubuntu with the module zendframework/zend-queue.
In the GUI I see ActiveMQ messages and everything seems ok.
But when messages are read some of them (approximatively half of them) have
a /null /body :
class StompFrame#197 (3) { public $command => string(7) "MESSAGE" public
$headers => array(6) { 'message-id' => string(53)
"ID:SERVEUR-ANNONCES-58495-1402203029958-2:7:-1:1:2025" 'destination' =>
string(39) "/queue//iap/pdc" 'timestamp' => string(13) "1402409662262"
'expires' => string(1) "0" 'content-length' => string(4) "8183"
'priority' => string(1) "4" } public $body => NULL}
Here is the code of the consumer :
while ( $this->stomp->hasFrame () ) { $frame = $this->stomp->readFrame ();
$message = unserialize ( $frame->body ); if (is_array ( $message )) {
$resultat = $this->treatMessage ( $message ); } else {
var_dump($frame); $this->logger->log ( "Invalid Message body : " .
var_export ( $frame->body, true ), Zend_Log::WARN ); }//... other
treatments $this->stomp->ack ( $frame ); }
Do you have any idea where is the problem ?

Viewing all articles
Browse latest Browse all 5648

Trending Articles