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
- Host: GitHub
- URL: https://github.com/vijaycs85/stompclient
- Owner: vijaycs85
- Created: 2014-07-22T11:18:47.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-05-17T23:33:28.000Z (almost 9 years ago)
- Last Synced: 2025-01-18T02:43:58.753Z (3 months ago)
- Language: PHP
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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] =>
)```