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

Abandoned → [devmustafa/yii2-amqp](/?search=devmustafa%2Fyii2-amqp)Yii-extension[Queues &amp; Workers](/categories/queues)

iviu96afa/yii2-amqp
===================

Yii2 extension enables you to use RabbitMQ with native Yii2 syntax

v1.0(9y ago)11.1k1GPL-3.0+PHPPHP &gt;=5.3.0

Since Aug 6Pushed 9y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (2)Used By (0)

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

[](#yii2-amqp)

Yii2 extension enables you to use RabbitMQ queuing with native Yii2 syntax.

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

[](#installation)

Via composer

```
$ php composer.phar require devmustafa/yii2-amqp "dev-master"

```

Or add

```
"devmustafa/yii2-amqp": "dev-master"

```

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

Also, add the following

```
'amqp' => [
	'class' => 'devmustafa\amqp\components\Amqp',
	'host' => '127.0.0.1',
	'port' => 5672,
	'user' => 'username',
	'password' => 'password',
	'vhost' => '/',
],

```

to the `components` section of your `config.php` file.

How to use
----------

[](#how-to-use)

1- Sending:

```
	$exchange = 'exchange';
	$queue = 'queue';
	$dataArray = array('x', 'y', 'z');
	$message = serialize($dataArray);

	Yii::$app->amqp->declareExchange($exchange, $type = 'direct', $passive = false, $durable = true, $auto_delete = false);
	Yii::$app->amqp->declareQueue($queue, $passive = false, $durable = true, $exclusive = false, $auto_delete = false);
	Yii::$app->amqp->bindQueueExchanger($queue, $exchange, $routingKey = $queue);
	Yii::$app->amqp->publish_message($message, $exchange, $routingKey = $queue, $content_type = 'applications/json', $app_id = Yii::$app->name);

```

2- Receiving:

```
	set_time_limit(0);
	error_reporting(E_ALL);

	use devmustafa\amqp\PhpAmqpLib\Connection\AMQPConnection;

	$exchange = 'exchange';
	$queue = 'queue';
	$consumer_tag = 'consumer_1';

	$conn = new AMQPConnection('localhost', 5672, 'username', 'password', '/');
	$ch = $conn->channel();
	$ch->exchange_declare($exchange, 'direct', false, true, false);
	$ch->queue_bind($queue, $exchange);

	function process_message($msg) {
		$body = unserialize($msg->body);
	}

	$ch->basic_consume($queue, $consumer_tag, false, false, false, false, 'process_message');

	function shutdown($ch, $conn) {
		$ch->close();
		$conn->close();
	}

	register_shutdown_function('shutdown', $ch, $conn);

	// Loop as long as the channel has callbacks registered
	while (count($ch->callbacks)) {
		$ch->wait();
	}

```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

3566d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/770c173ff53dc9bc3faca2adc4f47b1fa5e93b393baefc3b9ef33da496127916?d=identicon)[devmustafa](/maintainers/devmustafa)

---

Top Contributors

[![MustafaMagdi](https://avatars.githubusercontent.com/u/1572395?v=4)](https://github.com/MustafaMagdi "MustafaMagdi (3 commits)")

---

Tags

rabbitmqextensionAMQPyii

### Embed Badge

![Health badge](/badges/iviu96afa-yii2-amqp/health.svg)

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

###  Alternatives

[webtoucher/yii2-amqp

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

60133.5k1](/packages/webtoucher-yii2-amqp)[mikemadisonweb/yii2-rabbitmq

Wrapper based on php-amqplib to incorporate messaging in your Yii2 application via RabbitMQ. Inspired by RabbitMqBundle for Symfony 2, really awesome package.

74262.1k1](/packages/mikemadisonweb-yii2-rabbitmq)[php-amqplib/thumper

AMQP Tools

276210.8k8](/packages/php-amqplib-thumper)[videlalvaro/thumper

AMQP Tools

27783.1k3](/packages/videlalvaro-thumper)[kunalvarma05/laravel-rabbitmq

Work with RabbitMQ in Laravel.

1853.7k](/packages/kunalvarma05-laravel-rabbitmq)

PHPackages © 2026

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