PHPackages                             meioa/php-mq - 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. meioa/php-mq

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

meioa/php-mq
============

A library for MQ message listening and sending based on PHP AMQP extension

v1.0.2(7mo ago)15MITPHP

Since Oct 11Pushed 7mo agoCompare

[ Source](https://github.com/cpptpp/php-mq)[ Packagist](https://packagist.org/packages/meioa/php-mq)[ RSS](/packages/meioa-php-mq/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

PHP-MQ
======

[](#php-mq)

A simple library for MQ message listening and sending based on PHP AMQP extension

Installation
------------

[](#installation)

```
composer require meioa/php-mq
```

Example
-------

[](#example)

```
    use PhpMq\Consumer;
    use PhpMq\Producer;
    //连接配置信息
    $config = [
        'host'      => '127.0.0.1',
        'port'      => 5672,
        'login'     => 'guest',
        'password'  => 'guest',
        'vhost'     => '/',
        ];
    //定义消息处理函数
    $callback = function(AMQPEnvelope $envelope){
        var_export($envelope);
        echo PHP_EOL;
//        echo " [x] Received ", $envelope->getBody(), PHP_EOL;
//        $headers = $envelope->getHeaders();
//        echo "Headers: " . json_encode($headers) . PHP_EOL;
//        echo "Content Type: " . $envelope->getContentType() . "\n";

    };
    //监听 指定队列，处理消息
    (new Consumer($config))->run('q11',$callback);

    $data = ['a'=>123,'b'=>'vv'];
    //创建 指定交换机 的连接实例
    $producer = new Producer($config,'et5');
    //发送消息
    $producer->send($data,'route');
    //发送持久化消息 ,rabbitMq-server 重启后消息不丢失
    $producer->setDeliveryMode()->send($data,'route');
    //向指定 header 类型交换机 发送 带有headers 参数的 消息
    $producer->send($data,'',['h'=>2]);
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance64

Regular maintenance activity

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

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

Total

3

Last Release

217d ago

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/meioa-php-mq/health.svg)

```
[![Health](https://phpackages.com/badges/meioa-php-mq/health.svg)](https://phpackages.com/packages/meioa-php-mq)
```

###  Alternatives

[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.3M26](/packages/league-geotools)[enqueue/enqueue

Message Queue Library

19820.0M56](/packages/enqueue-enqueue)[deliciousbrains/wp-background-processing

WP Background Processing can be used to fire off non-blocking asynchronous requests or as a background processing tool, allowing you to queue tasks.

1.1k409.8k6](/packages/deliciousbrains-wp-background-processing)[react/async

Async utilities and fibers for ReactPHP

2228.8M171](/packages/react-async)[react/promise-stream

The missing link between Promise-land and Stream-land for ReactPHP

11512.9M45](/packages/react-promise-stream)[illuminate/bus

The Illuminate Bus package.

6043.8M409](/packages/illuminate-bus)

PHPackages © 2026

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