PHPackages                             xutl/yii2-broadcast - 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. xutl/yii2-broadcast

ArchivedYii2-extension[Queues &amp; Workers](/categories/queues)

xutl/yii2-broadcast
===================

The broadcast queue extension for the Yii framework

1.0.4(8y ago)07MITPHP

Since Aug 21Pushed 8y agoCompare

[ Source](https://github.com/xutl/yii2-broadcast)[ Packagist](https://packagist.org/packages/xutl/yii2-broadcast)[ RSS](/packages/xutl-yii2-broadcast/feed)WikiDiscussions master Synced today

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

yii2-broadcast
==============

[](#yii2-broadcast)

[![Latest Stable Version](https://camo.githubusercontent.com/232eeec0c2a51d1589bbdcef52bc0fd078a75bf87e3c57dda419fef4bda79e7d/68747470733a2f2f706f7365722e707567782e6f72672f7875746c2f796969322d62726f6164636173742f762f737461626c652e706e67)](https://packagist.org/packages/xutl/yii2-broadcast)[![Total Downloads](https://camo.githubusercontent.com/0f70bc65970b82bd8cc6458b7de15256eb3d88b883a2114188bf47850af534f7/68747470733a2f2f706f7365722e707567782e6f72672f7875746c2f796969322d62726f6164636173742f646f776e6c6f6164732e706e67)](https://packagist.org/packages/xutl/yii2-broadcast)[![Reference Status](https://camo.githubusercontent.com/59d01998a10fd49fc43176f9cb850072f638d08bb856e0b19d00350d337fcb48/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f7875746c3a796969322d62726f6164636173742f7265666572656e63655f62616467652e737667)](https://www.versioneye.com/php/xutl:yii2-broadcast/references)[![Build Status](https://camo.githubusercontent.com/6f489f8f643fce27a23d14df19ec1fe769d0d5e50224b9b4238dae48c29ceaa7/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7875746c2f796969322d62726f6164636173742e737667)](http://travis-ci.org/xutl/yii2-broadcast)[![Dependency Status](https://camo.githubusercontent.com/3768417d13f4a0b62fc4c35aeb769781e0ebfcf4439fc946754faea7811d5c58/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f7875746c3a796969322d62726f6164636173742f6465762d6d61737465722f62616467652e706e67)](https://www.versioneye.com/php/xutl:yii2-broadcast/dev-master)[![License](https://camo.githubusercontent.com/7930fc1cac24131df71a38bd7ed2b9911569c1fd5cd8798af8adf57b3e954d20/68747470733a2f2f706f7365722e707567782e6f72672f7875746c2f796969322d62726f6164636173742f6c6963656e73652e737667)](https://packagist.org/packages/xutl/yii2-broadcast)

Installation
------------

[](#installation)

Next steps will guide you through the process of installing yii2-broadcast using [composer](http://getcomposer.org/download/). Installation is a quick and easy three-step process.

### Install component via composer

[](#install-component-via-composer)

Either run

```
composer require --prefer-dist xutl/yii2-broadcast

```

or add

```
"yuncms/yii2-broadcast": "~1.0.0"
```

to the `require` section of your composer.json.

### Configuring your application

[](#configuring-your-application)

Add following lines to your main configuration file:

```
'components' => [
    'broadcast' => [
        'class' => 'xutl\broadcast\Broadcast',
        'endPoint' => 'http://abcdefg.mns.cn-hangzhou.aliyuncs.com/',
        'accessId' => '1234567890',
        'accessKey' => '1234567890',
    ],
    //etc
],
```

### Use broadcast

[](#use-broadcast)

```
/** @var \xutl\broadcast\Broadcast $broadcast */
$broadcast = Yii::$app->broadcast;

$topicName = 'CreateTopicAndPublishMessageExample';
$broadcast->create($topicName);

$topic = $broadcast->getTopicRef($topicName);
$subscriptionName = "SubscriptionExample";

try{
    $res = $topic->subscribe($subscriptionName,'https://www.baidu.com','test.test');
    echo "SubscriptionCreated! \n";
}catch (MnsException $e){
    echo "CreateSubscriptionFailed: " . $e;
    return;
}

$messageBody = "test";
$res = $topic->publishMessage($messageBody, 'test.test');
var_dump($res);
```

```
class ApiController extends \yii\web\Controller
{
    public function actions()
    {
        return [
            /**
             * Returns an access token.
             */
            'callback' => [
                'class' => \xutl\broadcast\TopicAction::classname(),
                'callback'=>[$this, 'callback'],
            ],
        ];
    }

    /**
     *
     */
    public function callback($params)
    {
        print_r($params);
    }
}
```

License
-------

[](#license)

This is released under the MIT License. See the bundled [LICENSE.md](LICENSE.md)for details.

###  Health Score

27

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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

5

Last Release

3134d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/87b658aa9d49e0c80cfc609fa2b9dc6d615672b1d895f421f751945a0e394087?d=identicon)[larvacent](/maintainers/larvacent)

---

Top Contributors

[![xutl](https://avatars.githubusercontent.com/u/20939388?v=4)](https://github.com/xutl "xutl (16 commits)")

---

Tags

queueyii2aliyunBroadcast

### Embed Badge

![Health badge](/badges/xutl-yii2-broadcast/health.svg)

```
[![Health](https://phpackages.com/badges/xutl-yii2-broadcast/health.svg)](https://phpackages.com/packages/xutl-yii2-broadcast)
```

###  Alternatives

[trntv/yii2-command-bus

Yii2 Command Bus extension

57613.9k7](/packages/trntv-yii2-command-bus)[nuwber/rabbitevents

The Nuwber RabbitEvents package

120510.8k2](/packages/nuwber-rabbitevents)[ignatenkovnikita/yii2-queuemanager

Yii2 Queue Manager

2061.4k2](/packages/ignatenkovnikita-yii2-queuemanager)

PHPackages © 2026

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