Print
PHP

Stomp client for PHP

Overview

[PHP Stomp client|http://code.google.com/p/stompcli/ that supports various connection methods and mechanisms for transforming messages to suitable formats. Check documentation for complete feature list.

Download

Download the current release from http://code.google.com/p/stompcli/downloads/list

Quick Start

After you download the archive, extract it to your include_path. Once you've done that, you can use the client as follows

<?php
// include a library
require_once("Stomp.php");
// make a connection
$con = new Stomp("tcp://localhost:61613");
// connect
$con->connect();
// send a message to the queue
$con->send("/queue/test", "test");
// subscribe to the queue
$con->subscribe("/queue/test");
// receive a message from the queue
$msg = $con->readFrame();

// do what you want with the message
if ( $msg->body === "test") {
    echo "Worked\n";
    // mark the message as received in the queue
    $con->ack($msg);
} else {
    echo "Failed\n";
}

// disconnect
$con->disconnect();

Developers

Source

Use this command to anonymously check out the latest project source code:

svn checkout http://stompcli.googlecode.com/svn/trunk/ stompcli-read-only

Unit Testing

Instructions on how to set up a unit testing environment could be found here

See Also

Powered by Atlassian Confluence