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

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

jaslin/yii2-amqp
================

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

v1.0.0(11y ago)01602BSD-3-ClausePHPPHP &gt;=5.3.0

Since Jul 24Pushed 10y agoCompare

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

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

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

[](#yii2-amqp)

AMQP extension wrapper to communicate with RabbitMQ server. Based on [videlalvaro/php-amqplib](https://github.com/videlalvaro/php-amqplib).

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

[](#installation)

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

Either run

```
$ php composer.phar require webtoucher/yii2-amqp "*"

```

or add

```
"webtoucher/yii2-amqp": "*"

```

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

Add the following in your console config:

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

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

```
