PHPackages                             devyk/yii2-amqp - 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. devyk/yii2-amqp

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

devyk/yii2-amqp
===============

Yii 2 extension wrapper to communicate with RabbitMQ server via AMQP. Based on videlalvaro/php-amqplib.

v1.0.5(8y ago)136.7k↓50%11BSD-3-ClausePHPPHP &gt;=5.3.0

Since Jul 24Pushed 8y ago1 watchersCompare

[ Source](https://github.com/kyrylo-permiakov/yii2-amqp)[ Packagist](https://packagist.org/packages/devyk/yii2-amqp)[ Docs](https://github.com/devyk/yii2-amqp)[ RSS](/packages/devyk-yii2-amqp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (8)Used By (1)

yii2-amqp
=========

[](#yii2-amqp)

AMQP extension wrapper to communicate with RabbitMQ server. Based on [php-amqplib/php-amqplib](https://github.com/php-amqplib/php-amqplib). This fork provides an alternative list of the parameters to be able to listen on multiple queues with one worker.

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Add the following lines

```
...
"repositories":[
    {
      "type":"git",
      "url":"https://github.com/M0nsterLabs/yii2-migration-aware-module"
    },
],
...
"devyk/yii2-amqp": "1.0.2"

```

to your `composer.json` file.

Add the following in your console config:

```
return [
    ...
    'components' => [
        ...
        'amqp' => [
            'class' => 'devyk\amqp\components\Amqp',
            'host' => '127.0.0.1',
            'port' => 5672,
            'user' => 'your_login',
            'password' => 'your_password',
            'vhost' => '/',
        ],
        ...
    ],
    ...
    'controllerMap' => [
        ...
        'rabbit' => [
            'class' => 'devyk\amqp\controllers\AmqpListenerController',
            'interpreters' => [
                'my-exchange' => 'app\components\RabbitInterpreter', // interpreters for each exchange
            ],
        ],
        ...
    ],
    ...
];
```

Add messages interpreter class `@app/components/RabbitInterpreter` with your handlers for different routing keys:

```
