You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by jodorn2 <do...@free.fr> on 2014/06/10 17:07:58 UTC
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 ?
--
View this message in context: http://activemq.2283324.n4.nabble.com/Null-body-when-consuming-from-php-application-tp4681963.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Null body when consuming from php application
Posted by jodorn2 <do...@free.fr>.
If someone encounters the same problem, here's a solution: after replacing
the Stomp api by Zend_Queue (included in the Zend framework version 1) with
the Activemq adapter, everything works normally.
--
View this message in context: http://activemq.2283324.n4.nabble.com/Null-body-when-consuming-from-php-application-tp4681963p4682066.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.