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(8mo ago)25MITPHP

Since Oct 11Pushed 8mo 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 today

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

29

—

LowBetter than 57% of packages

Maintenance59

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

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

262d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/65895729?v=4)[cpptpp](/maintainers/cpptpp)[@cpptpp](https://github.com/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.6M31](/packages/league-geotools)[illuminate/bus

The Illuminate Bus package.

6046.3M542](/packages/illuminate-bus)[uecode/qpush-bundle

Asynchronous processing for Symfony using Push Queues

1672.5M2](/packages/uecode-qpush-bundle)[belvg/module-sqs

N/A

1544.6k](/packages/belvg-module-sqs)[bsidev/bitrix-queue

Queues for Bitrix CMS

232.8k](/packages/bsidev-bitrix-queue)[mayconbordin/l5-stomp-queue

Stomp Queue Driver for Laravel 5

121.1k](/packages/mayconbordin-l5-stomp-queue)

PHPackages © 2026

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