Using Topics from PHP over Stomp
$clientId = 'test:dev';
$topic = '/topic/perm.user';
try {
$stomp = new Stomp('tcp://localhost:61613','system','manager', array('client-id'=> $clientId ));
} catch(StompException $e) {
die('Connection failed: ' . $e->getMessage());
}
$isSubscribe = $stomp->subscribe($topic);
while($isSubscribe){
if ($stomp->hasFrame()) {
$frame = $stomp->readFrame();
if ($frame != NULL) {
print "Received: " . $frame->body . " - time now is " . date("Y-m-d H:i:s"). "\n";
// $stomp->ack($frame);
}
// sleep(1);
}
else {
print "No frames to read\n";
}
}
if($isSubscribe){
$stomp->unsubscribe($topic);
unset($stomp);
}
Can not receive the topic frame