PHPackages                             pupilcp/rabbitmq-warning - 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. pupilcp/rabbitmq-warning

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

pupilcp/rabbitmq-warning
========================

rabbitmq服务监控预警

1.0.2(5y ago)516MITPHPPHP &gt;=7.0

Since Sep 6Pushed 5y ago1 watchersCompare

[ Source](https://github.com/pupilcp/rabbitmq-warning)[ Packagist](https://packagist.org/packages/pupilcp/rabbitmq-warning)[ RSS](/packages/pupilcp-rabbitmq-warning/feed)WikiDiscussions master Synced 2w ago

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

PHP版本 - rabbitmq-warning
------------------------

[](#php版本---rabbitmq-warning)

### 简介

[](#简介)

rabbitmq-warning使用PHP实现，配合定时计划任务，对Rabbitmq服务监控预警

### 功能实现

[](#功能实现)

1. rabbitmq服务连接是否正常
2. rabbitmq队列是否存在消息积压
3. 推送数据给rabbitmq队列的速度（暂未实现）

### 特点

[](#特点)

1. 使用swoole process派生子进程，对rabbitmq服务和队列的消息长度进行监控
2. 使用redis对队列消息积压的次数进行记录
3. 当服务需要告警，可使用钉钉/邮件/短信方式预警（目前只实现了钉钉通知）。
4. 可以单独作为服务使用，也可以与PHP框架无缝结合。

### 设计模型

[](#设计模型)

[![设计模型](docs/design.png)](docs/design.png)

### 安装

[](#安装)

环境依赖：

1. php &gt;= 7.0
2. swoole扩展（版本无要求）
3. redis扩展 &gt;= 2.6
4. amqp扩展（操作rabbitmq）

##### 独立安装：

[](#独立安装)

- git clone
- 进入目录：composer install

##### 接入项目：

[](#接入项目)

- composer require pupilcp/rabbitmq-warning

### 使用

[](#使用)

复制根目录下的config.demo.php，并重命名为：config.php，修改配置文件里的参数。 主要配置说明：

```
//连接MQ失败预警
'connectRules' => [
    'connectFailTimes' => 3, //单次执行，连续连接MQ失败达到预警的次数
    'interval'         => 2, //尝试重连的时间间隔（单位：s）
    'mode'             => [ //预警模式
        'type'  => DINGDING_NOTICE,
        'token' => '钉钉机器人token', //钉钉机器人token
    ],
],
//监控队列配置【可添加多个队列】
'queueRules' => [
    //队列名称
    'test' => [
        'name'             => 'test', //队列名称
        'vhost'            => 'v1',
		'isConsecutive'    => 1, //1： 在有效时间内连续达到预警数量， 0：不需要连续，只需要在有效时间内达到预警数量即可，不配置，默认为1
        'warningMsgCount'  => 10, //队列积压达到预警的数量
        'warningTimes'     => 3, //连续监控到队列积压达到预警的次数，结合warningMsgCount使用
        'duringTime'       => 600, //在有效duringTime的时间内，检测到队列的数量连续warningTimes次达到warningMsgCount，则预警
        'mode'             => [ //预警模式
            'type'  => DINGDING_NOTICE,
            'token' => '钉钉机器人token',
        ],
    ],
],

```

### 启动

[](#启动)

由于rabbitmq-warning不是常驻进程，需使用定时计划任务配合，例： \* \* \* \* \* php /PATH/server start （每分钟执行一次）

### 支持

[](#支持)

swoole

### 其它

[](#其它)

如有疑问，请邮件联系：

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

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

Total

3

Last Release

1918d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/45411407?v=4)[pupilcp](/maintainers/pupilcp)[@pupilcp](https://github.com/pupilcp)

---

Tags

rabbitmqMQ

### Embed Badge

![Health badge](/badges/pupilcp-rabbitmq-warning/health.svg)

```
[![Health](https://phpackages.com/badges/pupilcp-rabbitmq-warning/health.svg)](https://phpackages.com/packages/pupilcp-rabbitmq-warning)
```

###  Alternatives

[php-amqplib/php-amqplib

Formerly videlalvaro/php-amqplib. This library is a pure PHP implementation of the AMQP protocol. It's been tested against RabbitMQ.

4.6k129.9M974](/packages/php-amqplib-php-amqplib)[php-amqplib/rabbitmq-bundle

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

1.2k20.7M68](/packages/php-amqplib-rabbitmq-bundle)[queue-interop/queue-interop

Promoting the interoperability of MQs objects. Based on Java JMS

48131.3M95](/packages/queue-interop-queue-interop)[bunny/bunny

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

7466.7M42](/packages/bunny-bunny)[enqueue/enqueue-bundle

Message Queue Bundle

27515.9M41](/packages/enqueue-enqueue-bundle)[enqueue/enqueue

Message Queue Library

19020.5M62](/packages/enqueue-enqueue)

PHPackages © 2026

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