PHPackages                             nailfor/php-queue-client - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. nailfor/php-queue-client

ActiveLibrary[Queues &amp; Workers](/categories/queues)

nailfor/php-queue-client
========================

a queue broker client library for php

v1.2.8(4y ago)01.3kLGPL-3.0-or-laterPHPCI failing

Since Nov 13Pushed 4y ago1 watchersCompare

[ Source](https://github.com/nailfor/phpQueueClient)[ Packagist](https://packagist.org/packages/nailfor/php-queue-client)[ RSS](/packages/nailfor-php-queue-client/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (2)Versions (12)Used By (0)

PHP MQTT Client
===============

[](#php-mqtt-client)

phpQueueClient is an client library for AMQP and MQTT queues server. Its based on the reactPHP socket-client

Goal
----

[](#goal)

Goal of this project is easy to use both AMQP and MQTT client for PHP in a modern architecture without using any php modules. Original idea taken from

- yes it correctly supports both qos protocols
- yes it works with huge data in a packet
- yes it can receive, ping, unsubscribe and publish
- Protocol specifications:

Example publish
---------------

[](#example-publish)

```
use nailfor\queue\ClientFactory;
use nailfor\queue\protocol\MQTT;

class MQTTClass
{
    public function subscribe()
    {
        $url    = '127.0.0.1:5672';

        $options = [
            //'username'  => '',
            //'password'  => '',
            'clientId'  => 'php',
            'cleanSession' => false,

            'topics'    => [
                'topic_name' => [
                    //this flag clear message after reciev. Default true
                    //'clear'     => false,
                    'qos'       => 1, //only for MQTT
                    'message'    => 'hello from topic',
                ],
                'capital_name' => [
                    'qos'       => 2, //only for MQTT
                    'message'    => 'hello from capital',
                ],
            ],
        ];

        $protocol = new MQTT; //default AMQP
        ClientFactory::publish($url, $options, [$this, 'onError'], $protocol);
    }
}
```

Example subscribe
-----------------

[](#example-subscribe)

```
use nailfor\queue\ClientFactory;
use nailfor\queue\protocol\MQTT;
use Illuminate\Support\Facades\Log;

class MQTTClass
{
    public function onMessage($packet)
    {
        //...
    }

    public function onCapitalMessage($packet)
    {
        //...
    }

    public function onError($reason) {
        echo $reason->getMessage(). PHP_EOL;
        exit;
    }

    public function subscribe()
    {
        $url    = '127.0.0.1:5672';

        $options = [
            //'username'  => '',
            //'password'  => '',
            'clientId'  => 'php',
            'cleanSession' => false,

            'topics'    => [
                'topic_name' => [
                    //this flag clear message after reciev. Default true
                    //'clear'     => false,
                    'qos'       => 1, //only for MQTT
                    'events'    => [
                        'PUBLISH' => [$this, 'onMessage'],
                    ],
                ],
                'capital_name' => [
                    'qos'       => 0, //only for MQTT
                    'events'    => [
                        'PUBLISH' => [$this, 'onCapitalMessage'],
                    ],
                ],
            ],
        ];

        $protocol = new MQTT; //default AMQP
        $logger = Log::channel('stderr'); //default null
        ClientFactory::run($url, $options, [$this, 'onError'], $protocol, $logger);
    }
}
```

also commands are available

```
ClientFactory::run //subscribe and get messages

ClientFactory::publish

ClientFactory::unsubscribe

ClientFactory::ping

```

The Logger suppurt 3 level of details: notice, info and debug. Offcourse you can disable it set null in last param

Notice - (Oct 21th, 2020)
-------------------------

[](#notice---oct-21th-2020)

Currently work:

- AMQP implementation:
- publish.. not yet
- subscribe
- unsubscribe
- MQTT implementation:
- - qos 1
- - qos 2
- subscribe
- unsubscribe
- publish

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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 ~68 days

Recently: every ~84 days

Total

11

Last Release

1693d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f0e23d07efd81dccb69223c1ef1897b2aa0d3eb74d7b2ee3627160406d43334?d=identicon)[nailfor](/maintainers/nailfor)

---

Top Contributors

[![nailfor](https://avatars.githubusercontent.com/u/13346879?v=4)](https://github.com/nailfor "nailfor (7 commits)")

---

Tags

reactphpAMQPiotmqtt

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nailfor-php-queue-client/health.svg)

```
[![Health](https://phpackages.com/badges/nailfor-php-queue-client/health.svg)](https://phpackages.com/packages/nailfor-php-queue-client)
```

###  Alternatives

[bunny/bunny

Performant pure-PHP AMQP (RabbitMQ) non-blocking ReactPHP library

7426.5M37](/packages/bunny-bunny)[react/socket

Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP

1.3k116.9M402](/packages/react-socket)[react/dns

Async DNS resolver for ReactPHP

536114.1M100](/packages/react-dns)[react/promise-timer

A trivial implementation of timeouts for Promises, built on top of ReactPHP.

34141.9M96](/packages/react-promise-timer)[react/async

Async utilities and fibers for ReactPHP

2228.8M171](/packages/react-async)[clue/socks-react

Async SOCKS proxy connector client and server implementation, tunnel any TCP/IP-based protocol through a SOCKS5 or SOCKS4(a) proxy server, built on top of ReactPHP.

1171.1M33](/packages/clue-socks-react)

PHPackages © 2026

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