2017 © Pedro Peláez
 

library stomp

STOMP protocol implementation

image

xp-forge/stomp

STOMP protocol implementation

  • Saturday, October 28, 2017
  • by thekid
  • Repository
  • 6 Watchers
  • 1 Stars
  • 29,603 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 18 Versions
  • 7 % Grown

The README.md

STOMP protocol implementation

Build status on GitHub XP Framework Module BSD Licence Requires PHP 7.0+ Supports PHP 8.0+ Latest Stable Version, (*1)

About

STOMP is a network protocol to talk to message brokers such as Apache ActiveMQ or RabbitMQ., (*2)

The STOMP specification can be found at http://stomp.github.io/., (*3)

Examples

Producer

A message producer, (*4)

use peer\stomp\{Connection, SendableMessage};

$conn= new Connection('stomp://localhost:61613/');
$conn->connect();

$conn->getDestination('/queue/producer')->send(
  new SendableMessage('Message contents', 'text/plain')
);

Consumer

A simple message consumer (subscriber):, (*5)

use peer\stomp\{Connection, Subscription};

$conn= new Connection('stomp://localhost:61613/');
$conn->connect();

$conn->subscribeTo(new Subscription('/queue/producer', function($message) {
  Console::writeLine('---> Received message: ', $message);
  $message->ack();
}));

$conn->consume();

Multi-endpoint failover

A consumer with a broker network may connect to any host when available:, (*6)

use peer\stomp\{Connection, Subscription, Failover};

$nodes= ['stomp://one.example.com:61613/', 'stomp://two.example.com:61613/'];

// Connect randomly to one or the other
$conn= new Connection(Failover::using($nodes)->byRandom());
$conn->connect();

$conn->subscribeTo(new Subscription('/queue/producer', function($message) {
  Console::writeLine('---> Received message: ', $message);
  $message->ack();
}));

$conn->consume();

For more examples, please see the examples/ directory., (*7)

The connection URL

The URL specifies the options how and where to connect:, (*8)

  • protocol should be stomp or stomp+ssl
  • host is the hostname to connect
  • port is the port to connect (default: 61613)
  • user, pass can be given in the URL and will be used for authentication
  • Supported parameters:
    • vhost - virtual host name, since STOMP 1.1 (eg. ?vhost=example.com)
    • versions - to specify list of supported versions (eg. ?versions=1.0,1.1); default is to support 1.0, 1.1

The Versions

11/09 2017
02/11 2016
31/10 2016
27/10 2016
20/09 2016
29/08 2016
21/02 2016

v9.0.0

9.0.0.0 http://xp-framework.net/

STOMP protocol implementation

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

24/01 2016

v8.0.2

8.0.2.0 http://xp-framework.net/

STOMP protocol implementation

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

24/01 2016

v8.0.1

8.0.1.0 http://xp-framework.net/

STOMP protocol implementation

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

20/12 2015

v8.0.0

8.0.0.0 http://xp-framework.net/

STOMP protocol implementation

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

26/09 2015

v7.1.0

7.1.0.0 http://xp-framework.net/

STOMP protocol implementation

  Sources   Download

BSD-3-Clause

The Requires

 

module xp

12/07 2015

v7.0.2

7.0.2.0 http://xp-framework.net/

STOMP protocol implementation

  Sources   Download

BSD-3-Clause

The Requires

 

module xp

25/06 2015

dev-series-5

dev-series-5 http://xp-framework.net/

STOMP protocol implementation

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0
  • xp-framework/xp-framework ~5.11

 

module xp

25/06 2015

v6.0.3

6.0.3.0 http://xp-framework.net/

STOMP protocol implementation

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0
  • xp-framework/xp-framework ~5.11

 

module xp

12/02 2015

v7.0.1

7.0.1.0 http://xp-framework.net/

STOMP protocol implementation

  Sources   Download

BSD-3-Clause

The Requires

 

module xp

11/01 2015

v7.0.0

7.0.0.0 http://xp-framework.net/

STOMP protocol implementation

  Sources   Download

BSD-3-Clause

The Requires

 

module xp