PHPackages                             adcbguo/think\_rabbit\_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. adcbguo/think\_rabbit\_mq

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

adcbguo/think\_rabbit\_mq
=========================

this is mall queue

1.0.0(6y ago)5131Apache-2.0PHPPHP &gt;=7.2.0

Since Nov 6Pushed 6y agoCompare

[ Source](https://github.com/adcbguo/thinkQueue)[ Packagist](https://packagist.org/packages/adcbguo/think_rabbit_mq)[ RSS](/packages/adcbguo-think-rabbit-mq/feed)WikiDiscussions master Synced today

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

基于RabbitMQ ThinkPHP 的队列封装
=========================

[](#基于rabbitmq-thinkphp-的队列封装)

安装使用
----

[](#安装使用)

```
composer require adcbguo/think_rabbit_mq

```

配置文件
----

[](#配置文件)

```

// 复制配置文件
vendor\adcbguo\think_rabbit_mq\rabbit_mq.php 文件到 config/rabbit_mq.php

// 配置自定义命令 config\console.php 增加一行
'queue:work' => 'queue\command\Work'

```

发布消息队列
------

[](#发布消息队列)

```
use Queue;
Queue::pash($job,$data,$attempts,['exchange' => 'mall_dev_log', 'queue' => 'mall_dev_log'])

```

`$job` 是任务名

> 执行队列消耗类fire,写类名即可 `app\log\jobs\ErrorLogJobs`

> 如果一个任务类里有多个小任务的话,需要用@+方法名 `app\log\jobs\OrderLogJobs@update`

`$data` 传递参数

> 是你要传到任务里的参数,必须是数组数据

> 在消耗类里使用 `$this->data` 获取

`$attempts` 执行次数

> 从第几次开始执行

`$mq` 虚拟机和队列

> 发布到那个虚拟机和队列

> 需要有对应的虚拟机和队列去消耗

监听任务并执行
-------

[](#监听任务并执行)

```
php think queue:work --exchange=mall_dev --queue=mall_dev --memory=128 --tries=3

```

> `exchange` RabbitMQ的虚拟机

> `queue` RabbitMQ的队列

> `memory` 单个进程使用的最大内存,超出内存会从新启动一个进程

> `tries` 单个消息执行最大次数

> 可配合`supervisor`使用，保证进程常驻

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Unknown

Total

1

Last Release

2379d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9740186?v=4)[郭冠常](/maintainers/adcbguo)[@adcbguo](https://github.com/adcbguo)

---

Top Contributors

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

---

Tags

rabbitmqthinkphp

### Embed Badge

![Health badge](/badges/adcbguo-think-rabbit-mq/health.svg)

```
[![Health](https://phpackages.com/badges/adcbguo-think-rabbit-mq/health.svg)](https://phpackages.com/packages/adcbguo-think-rabbit-mq)
```

###  Alternatives

[vladimir-yuldashev/laravel-queue-rabbitmq

RabbitMQ driver for Laravel Queue. Supports Laravel Horizon.

2.1k9.8M30](/packages/vladimir-yuldashev-laravel-queue-rabbitmq)[php-amqplib/rabbitmq-bundle

Integrates php-amqplib with Symfony &amp; RabbitMq. Formerly emag-tech-labs/rabbitmq-bundle, oldsound/rabbitmq-bundle.

1.3k20.1M65](/packages/php-amqplib-rabbitmq-bundle)[bschmitt/laravel-amqp

AMQP wrapper for Laravel and Lumen to publish and consume messages

2752.3M7](/packages/bschmitt-laravel-amqp)[topthink/think-queue

The ThinkPHP6 Queue Package

640675.0k75](/packages/topthink-think-queue)[enqueue/amqp-lib

Message Queue Amqp Transport

1078.5M61](/packages/enqueue-amqp-lib)[jwage/phpamqplib-messenger

Symfony messenger transport for the php-amqplib/php-amqplib library.

84149.7k1](/packages/jwage-phpamqplib-messenger)

PHPackages © 2026

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