PHPackages                             terranc/laravel-mns - 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. terranc/laravel-mns

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

terranc/laravel-mns
===================

Aliyun Mns Driver For Laravel Queue

1.0.3.1(5y ago)010MITPHP

Since Jun 1Pushed 5y agoCompare

[ Source](https://github.com/terranc/laravel-queue-aliyun-mns)[ Packagist](https://packagist.org/packages/terranc/laravel-mns)[ RSS](/packages/terranc-laravel-mns/feed)WikiDiscussions master Synced yesterday

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

Laravel-MNS
===========

[](#laravel-mns)

Laravel 队列的阿里云消息服务（MNS）驱动。

[![StyleCI PSR2](https://camo.githubusercontent.com/fc7de1a7c95ef820515b13723448366649587ea2120dfc648146d92343451f2b/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3133353636373833352f736869656c64)](https://github.styleci.io/repos/135667835)[![Build Status](https://camo.githubusercontent.com/ccd19a442293c83d1993965ae234abbe6f434f59375d703a230a8277b35bc4b1/68747470733a2f2f7777772e7472617669732d63692e6f72672f6d696c6b6d656f776f2f6c61726176656c2d71756575652d616c6979756e2d6d6e732e7376673f6272616e63683d6d6173746572)](https://www.travis-ci.org/milkmeowo/laravel-queue-aliyun-mns)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/6e0f2c1ce019e985b057b3cbc9f0a7bbe33b660552ea1fea238f74280de4a87a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d696c6b6d656f776f2f6c61726176656c2d71756575652d616c6979756e2d6d6e732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/milkmeowo/laravel-queue-aliyun-mns/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/5ee44b3276df2cc713b2527e0af9e9693d0cb46336b58bb2463cdbefa585bad1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d696c6b6d656f776f2f6c61726176656c2d71756575652d616c6979756e2d6d6e732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/milkmeowo/laravel-queue-aliyun-mns/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/549d798480c2e0ee45657cbd958e0ad163efb3be0cb1143f6c3642270260e1da/68747470733a2f2f706f7365722e707567782e6f72672f6d696c6b6d656f776f2f6c61726176656c2d6d6e732f762f737461626c65)](https://packagist.org/packages/milkmeowo/laravel-mns)[![Total Downloads](https://camo.githubusercontent.com/1cb9347bda5102c672cc5fa36bc9059c03cb5f2ffe95bd9384ecd6c93a9dd351/68747470733a2f2f706f7365722e707567782e6f72672f6d696c6b6d656f776f2f6c61726176656c2d6d6e732f646f776e6c6f616473)](https://packagist.org/packages/milkmeowo/laravel-mns)[![Latest Unstable Version](https://camo.githubusercontent.com/c896ce54689e233581f026fd4a6f21e38029420175a818833f921943085562e0/68747470733a2f2f706f7365722e707567782e6f72672f6d696c6b6d656f776f2f6c61726176656c2d6d6e732f762f756e737461626c65)](https://packagist.org/packages/milkmeowo/laravel-mns)[![License](https://camo.githubusercontent.com/4b1764def7fc2ecbc2245b07226d45c12faa83fba0c3c77048f5fd44a9ecaa4d/68747470733a2f2f706f7365722e707567782e6f72672f6d696c6b6d656f776f2f6c61726176656c2d6d6e732f6c6963656e7365)](https://packagist.org/packages/milkmeowo/laravel-mns)

安装
--

[](#安装)

```
composer require milkmeowo/laravel-mns
```

配置
--

[](#配置)

1.在 config/app.php 注册 ServiceProvider(Laravel 5.5 无需手动注册)

```
'providers' => [
       // ...
   Milkmeowo\LaravelMns\LaravelMnsServiceProvider::class,
],
```

2.在 `config/queue.php` 中增加 `mns` 配置：

```
'connections' => [
    'redis' => [
        'driver'     => 'redis',
        'connection' => 'default',
        'queue'      => 'default',
        'expire'     => 60,
    ],
    // 新增阿里云 MNS。
    'mns'   => [
       'driver'       => 'mns',
       'key'          => env('QUEUE_MNS_ACCESS_KEY', ''),
       'secret'       => env('QUEUE_MNS_SECRET_KEY', ''),
       'endpoint'     => env('QUEUE_MNS_ENDPOINT', ''),
       'queue'        => env('QUEUE_NAME',''),
       'wait_seconds' => env('QUEUE_WAIT_SECONDS', 30),
   ],
],
```

3.在 `.env` 增加

```
QUEUE_DRIVER=mns
QUEUE_NAME=your_queue_name
QUEUE_MNS_ACCESS_KEY=your_acccess_key
QUEUE_MNS_SECRET_KEY=your_secret_key
QUEUE_MNS_ENDPOINT=your-endpoint
# 关于 wait_seconds 可以看 https://help.aliyun.com/document_detail/35136.html
QUEUE_WAIT_SECONDS=30
```

使用
--

[](#使用)

正常使用 Laravel Queue 即可：

- [Laravel 队列服务（官方英文文档）](https://laravel.com/docs/5.6/queues)
- [Laravel 队列服务（中文文档）](https://laravel-china.org/docs/laravel/5.6/queues/1395)

命令
--

[](#命令)

### 列出所有队列

[](#列出所有队列)

```
php artisan queue:mns:list
// 例如
php artisan queue:mns:list
// 输入队列名以 prefix 开头的队列
php artisan queue:mns:list -p

# 请填写prefix:
# >
```

### 增加队列

[](#增加队列)

```
php artisan queue:mns:create 队列名
// 例如
php artisan queue:mns:create wechat-notify
```

### 删除队列

[](#删除队列)

```
php artisan queue:mns:delete 队列名
// 例如
php artisan queue:mns:delete wechat-notify
```

### 显示队列内容

[](#显示队列内容)

```
php artisan queue:mns:show 队列名
// 例如
php artisan queue:mns:show wechat-notify
```

### 删除队列所有内容

[](#删除队列所有内容)

```
php artisan queue:mns:flush 队列名
// 例如
php artisan queue:mns:flush wechat-notify
```

测试
--

[](#测试)

```
$ composer test
```

参考
--

[](#参考)

- [abrahamgreyson/laravel-mns](https://github.com/abrahamgreyson/laravel-mns)

许可
--

[](#许可)

MIT

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 81% 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 ~264 days

Total

5

Last Release

1848d ago

### Community

Maintainers

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

---

Top Contributors

[![milkmeowo](https://avatars.githubusercontent.com/u/22437128?v=4)](https://github.com/milkmeowo "milkmeowo (17 commits)")[![terranc](https://avatars.githubusercontent.com/u/224353?v=4)](https://github.com/terranc "terranc (3 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

---

Tags

laravelqueuealiyunmns

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/terranc-laravel-mns/health.svg)

```
[![Health](https://phpackages.com/badges/terranc-laravel-mns/health.svg)](https://phpackages.com/packages/terranc-laravel-mns)
```

###  Alternatives

[aliyunmq/mq-http-sdk

Aliyun Message Queue(MQ) Http PHP SDK, PHP&gt;=5.5.0

75379.9k14](/packages/aliyunmq-mq-http-sdk)[lokielse/laravel-mns

Aliyun MNS Queue Driver For Laravel

2614.9k](/packages/lokielse-laravel-mns)

PHPackages © 2026

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