I have to read messages from Topic in ActiveMQ + PHP(Stomp), for that I did below code,
try {
$stomp = new Stomp('tcp://localhost:61613');
} catch (StompException $e) {
die('Connection failed: ' . $e->getMessage());
}
$topic='/topic/mytopic';
$stomp->subscribe($topic);
$frame = $stomp->readFrame();
var_dump($frame);
But when I got result in var_dump($frame)
as bool(false)
. Instead of that in my topic there is some message. which I could not get it.
Can anybody suggest me solution?
the publisher is down?you only can receive the message when the topic message publish.
you can test at this step: 1、run publisher command 2、run the comsumer command(the first run publisher no quit)