connect(); #// send a message to the queue #$con->send("/topic/fedora.apim.update", "test"); #echo "Sent message with body 'test'\n"; // subscribe to the queue $con = new Stomp("tcp://localhost:61613"); $con->subscribe("/queue/fedora.apim.update"); // receive a message from the queue while (isset($con)) { $msg = $con->readFrame(); // do what you want with the message if ( $msg != null) { echo "Received message with body '$msg->body'\n"; // mark the message as received in the queue //$con->ack($msg); // unset($con); // unset con to return the message to the queue.\ // $con->ack($msg); // $con->send('/queue/fedora.apim.update',$msg->body); } else { echo "Failed to receive a message\n"; } } // disconnect #$con->disconnect(); } catch (StompException $e) { echo "StompException!"; var_dump($e); } ?>