activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwotman <jwot...@hotmail.com>
Subject hasFrameToRead always returns false after first message
Date Wed, 11 Nov 2009 21:15:24 GMT

I'm using PHP STOMP to read messages from activemq.  I am able to read one
message and then hasFrameToRead will always return false.  I switched to
Java to get the project out the door but want to solve this issue because
we'll want to talk to activemq from multiple languages.  I'm using version
5.3.  Here's the basic code:

public function getMessages(){

                $con = new Stomp(MESSAGING_BROKER_URL);
                $con ->connect('system','manager');
                $con->subscribe(MESSAGING_QUEUE_NAME);


                $messages = array();
                while($con->hasFrameToRead()){

                        $message = $con->readFrame();
                        $body = $message ->body;
                        $headers = $message ->headers;
                        $messageId = $headers['message-id'];
                        $messages[$messageId] = $body;


                }

                $con ->disconnect();
                return $messages;


        }

-- 
View this message in context: http://old.nabble.com/hasFrameToRead-always-returns-false-after-first-message-tp26308746p26308746.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message