An open API service indexing awesome lists of open source software.

https://github.com/vijaycs85/stompclient

Simple STOMP to JMQ server
https://github.com/vijaycs85/stompclient

Last synced: about 2 months ago
JSON representation

Simple STOMP to JMQ server

Awesome Lists containing this project

README

        

StompClient
===========

Simple STOMP to JMQ server

Example:
-------

```
// Custom headers to queue server or external service provider.
$headers = array(
'CustomHeader1' => 'Custom header value',
);
// Request & response queue location.
$queues = array(
'request' => '/queue/com.domain.service.request',
'response' => '/queue/com.domain.service.response',
);
// Request body string.
$body = 'foo';

// Message queue server URI.
$url = parse_url('tcp://example.com:61616');

$request = new StompRequest($headers, $body, $queues);
$stomp = new Stomp($url['scheme'] . '://' . $url['host'] . ':' . $url['port'], isset($url['user'])?$url['user']:NULL, isset($url['pass'])?$url['pass']:NULL);

$stomp_client = new StompClient($stomp);
$response = $stomp_client->getResponse($request);

unset($stomp);
print_r($response);
```
Output:
-------

```
StompFrame Object
(
[command] => MESSAGE
[headers] => Array
(
[message-id] => ID:394292-sample.mqserver.com-45964-1405009274970-0:1:8:1:15
[breadcrumbId] => ID:394292-sample.mqserver.com-37346-1399540645810-2:91707:-1:1:1
[CustomHeader1] => Custom header value
[destination] => /queue/com.domain.service.response
[timestamp] => 1406031094126
[expires] => 0
[priority] => 4
[reply-to] => /queue/com.domain.service.response
)

[body] =>
)

```