2017 © Pedro Peláez
 

library stomp

Pure PHP Stomp client. Support protocol v 1.0, 1.1, 1.2. RabbitMQ, Apache ActiveMQ

image

grimkirill/stomp

Pure PHP Stomp client. Support protocol v 1.0, 1.1, 1.2. RabbitMQ, Apache ActiveMQ

  • Thursday, October 1, 2015
  • by grimkirill
  • Repository
  • 0 Watchers
  • 3 Stars
  • 471 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 1 % Grown

The README.md

Stomp for PHP

Usage

<?php
/**
 * Create connection
 */
$client = new \Stomp\Client(array('tcp://127.0.0.1:61613'), array(
        'login' => 'admin',
        'passcode' => 'password',
        'host' => '/',
        'queue_prefix' => '/queue/',
    ));

$client->send('queue_destination', 'hello message');    

$client->subscribe('queue_destination');
while ($message = $client->readMessage()) {
    echo $message->getBody();
    $message->ack();
}

RPC example

server side example

<?php
require_once __DIR__ . '/../tests/Bootstrap.php';

$client = new \Stomp\Client('tcp://127.0.0.1:61613', array('login' => 'admin', 'passcode' => 'password'));

$consumer = new \Stomp\Helper\Consumer($client, '/queue/testing');

$endTime = new \DateTime('+30 second');
$condition = function () use ($endTime) {
    return ((new DateTime()) < $endTime);
};

$consumer->run(function($data, $headers) {
    var_dump($data);
    print_r($headers);
    return date('c');
}, $condition);

client side example

<?php
require_once __DIR__ . '/../tests/Bootstrap.php';

$client = new \Stomp\Client('tcp://127.0.0.1:61613', array('login' => 'admin', 'passcode' => 'password'));

$rpc = new \Stomp\Helper\Rpc($client, '/queue/testing');

var_dump($rpc->call('Ping')); // string(25) "2015-03-13T10:22:27+00:00"

The Versions

01/10 2015

dev-develop

dev-develop https://github.com/grimkirill/Stomp

Pure PHP Stomp client. Support protocol v 1.0, 1.1, 1.2. RabbitMQ, Apache ActiveMQ

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

rabbitmq stomp apache activemq activemq apollo

13/03 2015

dev-master

9999999-dev https://github.com/grimkirill/Stomp

Pure PHP Stomp client. Support protocol v 1.0, 1.1, 1.2. RabbitMQ, Apache ActiveMQ

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

rabbitmq stomp apache activemq activemq apollo

13/03 2015

1.1.0

1.1.0.0 https://github.com/grimkirill/Stomp

Pure PHP Stomp client. Support protocol v 1.0, 1.1, 1.2. RabbitMQ, Apache ActiveMQ

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

rabbitmq stomp apache activemq activemq apollo

09/07 2013

1.0.0.x-dev

1.0.0.9999999-dev https://github.com/grimkirill/Stomp

Work queues using Stomp protocol v 1.1. RabbitMQ, Apache ActiveMQ

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

rabbitmq stomp apache activemq activemq apollo

09/07 2013

1.0.0

1.0.0.0 https://github.com/grimkirill/Stomp

Work queues using Stomp protocol v 1.1. RabbitMQ, Apache ActiveMQ

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

rabbitmq stomp apache activemq activemq apollo