PHPackages                             fangchaogang/phpmq - 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. fangchaogang/phpmq

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

fangchaogang/phpmq
==================

PHP MQ

v1.0.1(4y ago)17BSD-3-ClausePHPPHP 7.\*

Since Oct 27Pushed 4y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (3)Versions (3)Used By (0)

phpmq
=====

[](#phpmq)

PHP队列集合（rabbitmq、redis、beanstalk）

### 安装

[](#安装)

```
composer require fangchaogang/phpmq "v1.*"
```

#### 使用rabbitmq

[](#使用rabbitmq)

```
use phpmq\drivers\amqp_interop\Queue;
$config = [
  "host"=>"127.0.0.1",
  "port"=>5672,
  "user" => "root",
  "password" => "root",
  "vhost"=>"/"
];
$queue = new Queue($config);
//---发消息
$job = new \phpmq\tests\TestJob();
$job->data = ['delay' => '5',];
//直接发
$queue->push($job);
//延时发
$queue->delay(1)->push($job);
//遇到错误N秒重试发
$queue->ttr(10)->push($job);
//带routingKey发
$queue->setRoutingKey('modify')->push($job);
//其他参考源码
//---监听
//直接监听
$queue->listen();
//带routingKey监听
$queue->regRoutingKeyCallback('modify', function ($messageData) {
    var_dump('this is modify routingKey', $messageData);
})->listen();
```

#### 使用redis

[](#使用redis)

```
use phpmq\drivers\redis\Queue;
$config = [
    'host' => '127.0.0.1',
    'port' => 6379
];
$queue = new Queue($config);
//---发消息
$job = new \phpmq\tests\TestJob();
$job->data = ['delay' => '5',];
//直接发
$queue->push($job);
//延时发
$queue->delay(1)->push($job);
//遇到错误N秒重试发
$queue->ttr(10)->push($job);
//---监听
//直接监听
$queue->listen();
```

#### 使用beanstalk

[](#使用beanstalk)

```
use phpmq\drivers\beanstalk\Queue;
$config = [
    'host'=>'150.158.185.89',
];
$queue = new Queue($config);
//---发消息
$job = new \phpmq\tests\TestJob();
$job->data = ['delay' => '5',];
//直接发
$queue->push($job);
//延时发
$queue->delay(1)->push($job);
//遇到错误N秒重试发
$queue->ttr(10)->push($job);
//---监听
//直接监听
$queue->listen();
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Total

2

Last Release

1656d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9f1ac7d4e81a6d433faf05cd888f8d424a8cfe7a0c5ee85a8faa0635ba1d7236?d=identicon)[fangchaogang](/maintainers/fangchaogang)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fangchaogang-phpmq/health.svg)

```
[![Health](https://phpackages.com/badges/fangchaogang-phpmq/health.svg)](https://phpackages.com/packages/fangchaogang-phpmq)
```

###  Alternatives

[nuwber/rabbitevents

The Nuwber RabbitEvents package

120515.8k3](/packages/nuwber-rabbitevents)[symfony/beanstalkd-messenger

Symfony Beanstalkd Messenger Bridge

19357.4k2](/packages/symfony-beanstalkd-messenger)[udokmeci/yii2-beanstalk

Yii2 Beanstalk Client at the top of Paul Annesley's pheanstalk

69125.3k3](/packages/udokmeci-yii2-beanstalk)[pmatseykanets/artisan-beans

Easily manage your Beanstalkd job queues right from the Laravel artisan command

4482.1k](/packages/pmatseykanets-artisan-beans)[wowo/wowo-queue-bundle

The WowoQueueBundle provides unified method for use queue systems, like Beanstalkd, RabbitMQ, flat files, database driven queues etc.

2228.0k1](/packages/wowo-wowo-queue-bundle)[n0nag0n/simple-job-queue

A simple library for interfacing with other job queue providers that gives you plenty of flexibility. Currently supports MySQL

351.8k1](/packages/n0nag0n-simple-job-queue)

PHPackages © 2026

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