PHPackages                             sansusan/yii2-rabbitmq - 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. sansusan/yii2-rabbitmq

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

sansusan/yii2-rabbitmq
======================

Yii2 rabbitmq

1.0.6(8y ago)01.8k1[1 issues](https://github.com/sansusan/yii2-rabbitmq/issues)BSD-3-ClausePHP

Since Sep 10Pushed 8y ago1 watchersCompare

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

READMEChangelog (7)DependenciesVersions (8)Used By (0)

yii2-rabbitmq
=============

[](#yii2-rabbitmq)

Yii2 Rabbimmq

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

[](#installation)

add

```
"sansusan/yii2-rabbitmq": "*"

```

to the require section of your composer.json file.

Used PhpAmqpLib
---------------

[](#used-phpamqplib)

add component in config file

```
'rabbit' => [
    'class' => 'sansusan\rabbitmq\RabbitPhpAmqpLib',
    'host' => '127.0.0.1',
    'amqpPort' => 5666,
    'login' => 'user_login',
    'pass' => 'user_pass',
    'vhost' => '/',
    'receiveQueueName' => 'receive_queue',
    'receiveWaitTimeout' => '10',
    'sendQueueName' => 'send_queue',
    'prefetchCount' => 1,
    'heartbeat' => 30,
    'read_write_timeout' => 60,
    'connection_timeout' => 3,
    'useSSL' => true,
    'caFilePath' => '/var/www/html/rabbitmq/cacert.pem',
    'autoACK' => false,
 ],

```

add console command

```
use PhpAmqpLib\Message\AMQPMessage;
use sansusan\rabbitmq\RabbitPhpAmqpLib;

class TestController extends \yii\console\Controller
{
    private function receiveCallback(AMQPMessage $message)
    {
        $body = $message->body;
        $rabbit = \Yii::$app->rabbit;
        $rabbit->sendACK($message);
    }

    public function actionRead()
    {
        $rabbit = \Yii::$app->rabbit;
        $rabbit->receive([$this, 'receiveCallback']);
    }

    public function actionSend($message)
    {
        $rabbit = \Yii::$app->rabbit;

        // add custom heeaders
        $headers = [
            'file_name' => 'test.xml',
        ];
        $rabbit->send($message, $headers);
    }
}

```

Used PECL amqp lib
------------------

[](#used-pecl-amqp-lib)

add component in config file

```
'rabbit_pecl' => [
    'class' => 'sansusan\rabbitmq\RabbitPeclAmqp',
    'host' => '127.0.0.1',
    'amqpPort' => 5666,
    'login' => 'user_login',
    'pass' => 'user_pass',
    'vhost' => '/',
    'receiveQueueName' => 'receive_queue',
    'receiveWaitTimeout' => '10',
    'sendQueueName' => 'send_queue',
    'prefetchCount' => 1,
    'heartbeat' => 30,
    'read_write_timeout' => 60,
    'connection_timeout' => 3,
    'useSSL' => true,
    'caFilePath' => '/var/www/html/rabbitmq/cacert.pem',
    'autoACK' => false,
 ],

```

add console command

```
use AMQPChannel;
use AMQPConnection;
use AMQPExchange;
use AMQPQueue;

class TestController extends \yii\console\Controller
{
    public function actionReadpecl()
        {
            $rabbit = \Yii::$app->rabbit_pecl;
            $message = $rabbit->receive();
            if ($message) {
                echo $message->getBody();
            }
        }

        public function actionSendpecl()
        {
            $rabbit = \Yii::$app->rabbit_pecl;
            $message = 'Hello from PECL amqp';
            $headers = [
                'some_name' => 'some_value',
            ];
            if ($rabbit->send($message, $headers))
                echo "Success\n";
        }
}

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity68

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

Total

7

Last Release

2997d ago

### Community

---

Top Contributors

[![sansusan](https://avatars.githubusercontent.com/u/9214957?v=4)](https://github.com/sansusan "sansusan (9 commits)")

### Embed Badge

![Health badge](/badges/sansusan-yii2-rabbitmq/health.svg)

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

###  Alternatives

[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.3M26](/packages/league-geotools)[amphp/parser

A generator parser to make streaming parsers simple.

14952.8M16](/packages/amphp-parser)[amphp/serialization

Serialization tools for IPC and data storage in PHP.

13451.1M18](/packages/amphp-serialization)[enqueue/enqueue

Message Queue Library

19820.0M56](/packages/enqueue-enqueue)[deliciousbrains/wp-background-processing

WP Background Processing can be used to fire off non-blocking asynchronous requests or as a background processing tool, allowing you to queue tasks.

1.1k409.8k6](/packages/deliciousbrains-wp-background-processing)[react/async

Async utilities and fibers for ReactPHP

2238.8M171](/packages/react-async)

PHPackages © 2026

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