PHPackages                             jeeinn/php-stomp-frame - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. jeeinn/php-stomp-frame

ActiveLibrary

jeeinn/php-stomp-frame
======================

just stomp frame generate and parse

v1.0.1(3y ago)13172MITPHPPHP &gt;=5.6

Since Jun 28Pushed 3y ago1 watchersCompare

[ Source](https://github.com/jeeinn/php-stomp-frame)[ Packagist](https://packagist.org/packages/jeeinn/php-stomp-frame)[ RSS](/packages/jeeinn-php-stomp-frame/feed)WikiDiscussions main Synced 6d ago

READMEChangelog (1)DependenciesVersions (4)Used By (0)

php-stomp-frame
===============

[](#php-stomp-frame)

just stomp frame generate and parse

`stomp frame` can be used for tcp、tls、wss

`stomp` 协议帧，可以用于 tcp、tls、wss等协议

Referer: [http://stomp.github.io/stomp-specification-1.2.html#Frames\_and\_Headers](http://stomp.github.io/stomp-specification-1.2.html#Frames_and_Headers)

Cases
-----

[](#cases)

`composer require jeeinn/php-stomp-frame`

#### Frame

[](#frame)

```
$userName = 'test';
$password = 'passcode';
$queue = 'service_queue_v1.2';

$stompFrame = new \Stomp\Frame();

# connect frame
$connectFrame = $stompFrame->setLogin($userName, $password)->setHeartBeat(0, 10000)->getConnect();
print_r($connectFrame);

# subscribe frame
$subscribeFrame = $stompFrame->getSubscribe($queue);
print_r($subscribeFrame);

# send frame
$sendFrame = $stompFrame->setBody('i am tester')->getSend($queue);
```

#### Parser

[](#parser)

```
$message = setLogin($userName, $password)->setHeartBeat(0, 10000)->getConnect();
# subscribe frame
$subscribeFrame = $stompFrame->getSubscribe($queue);

#use websocket
$client = new \WebSocket\Client($url);
$client->text($connectFrame);
//var_dump($client->isConnected());
$client->text($subscribeFrame);

# loop listening
while (true) {
    try {
        $message = $client->receive();
        $parsed = $stompFrame->parser($message);
        //print_r($parsed);
        # Error, Break while loop to stop listening, Possibly log errors
        if ($parsed['command'] == 'ERROR') {
            echo $parsed['body'];
            $client->close();
            break;
        }
        // Deal your data
        $data = json_decode($parsed['body'], true);
        print_r($data);
        // Act[enter image description here][4] on received message
        // Later, Break while loop to stop listening
    } catch (Exception $e) {
        // Possibly log errors
        echo $e->getMessage();
    }
}
```

if you get empty content, please refer to: [\#1 (comment)](https://github.com/jeeinn/php-stomp-frame/issues/1#issuecomment-1387311240)

Use tcp or ssl
--------------

[](#use-tcp-or-ssl)

Referer:

Todo
----

[](#todo)

- CONNECT
- SEND
- SUBSCRIBE
- UNSUBSCRIBE
- BEGIN
- COMMIT
- ABORT
- ACK
- NACK
- DISCONNECT

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~292 days

Total

3

Last Release

1200d ago

Major Versions

v0.1.1 → v1.0.02021-06-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/b4c1467c33e60574b9120ed16208140d0edbae8ab77aa2f6c7badac1df7da71f?d=identicon)[jeeinn](/maintainers/jeeinn)

---

Top Contributors

[![jeeinn](https://avatars.githubusercontent.com/u/13930054?v=4)](https://github.com/jeeinn "jeeinn (8 commits)")

---

Tags

phpstompstomp-clientstompwebsocket

### Embed Badge

![Health badge](/badges/jeeinn-php-stomp-frame/health.svg)

```
[![Health](https://phpackages.com/badges/jeeinn-php-stomp-frame/health.svg)](https://phpackages.com/packages/jeeinn-php-stomp-frame)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
