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

ActiveLibrary[Queues &amp; Workers](/categories/queues)

vkoori/amqp
===========

AMQP driver for Laravel/Lumen. Supports RabbitMQ.

1.0.3(3y ago)0736PHPPHP &gt;=8.1

Since Mar 9Pushed 3y agoCompare

[ Source](https://github.com/vkoori/amqp)[ Packagist](https://packagist.org/packages/vkoori/amqp)[ RSS](/packages/vkoori-amqp/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (3)Versions (6)Used By (0)

Installation
============

[](#installation)

install
-------

[](#install)

```
composer require vkoori/amqp
```

add service providers
---------------------

[](#add-service-providers)

In laravel application add this lines to your `config/app.php` file.

```
'providers' => [
    //...
    \Kooriv\MessageBroker\Providers\AMQP::class,
    \Kooriv\MessageBroker\Providers\Config::class
]
```

In lumen application add this lines to your `bootstrap/app.php` file.

```
$app->register(\Kooriv\MessageBroker\Providers\AMQP::class);
$app->register(\Kooriv\MessageBroker\Providers\Config::class);
```

generate config
---------------

[](#generate-config)

In laravel application you can use this command.

```
php artisan vendor:publish --provider="Kooriv\MessageBroker\Providers\Config" --tag="config"
```

In lumen application create the `config/amqp.php` file with the following content.

```
 env('AMQP_DRIVER', 'rabbitMQ'),
    'events' => Consumers::class,

    'rabbitMQ' => [
        'connection_type' => Connections::STREAM,
        'hosts' => [
            [
                'host' => env('RABBITMQ_HOST', '127.0.0.1'),
                'port' => env('RABBITMQ_PORT', 5672),
                'user' => env('RABBITMQ_USER', 'guest'),
                'password' => env('RABBITMQ_PASSWORD', 'guest'),
                'vhost' => env('RABBITMQ_VHOST', '/'),
            ]
        ],
        'ssl_options' => [
            'cafile' => env('RABBITMQ_SSL_CA_FILE', null),
            'local_cert' => env('RABBITMQ_SSL_PUBLIC_FILE', null),
            'local_pk' => env('RABBITMQ_SSL_PRIVATE_FILE', null),
            'verify_peer' => env('RABBITMQ_SSL_VERIFY_PEER', true),
            'verify_peer_name' => env('RABBITMQ_SSL_PASSPHRASE', false),
        ],
    ],

    // if you want to publish failed jobs in to the message broker, use the `failed_jobs` key
    'failed_jobs' => [
        'queueName' => env(key:'APP_NAME', default: 'amqp') . '_failed_job',
        'exchangeName' =>  env(key:'APP_NAME', default: 'amqp') . '_failed_job',
        'exchangeType' => ExchangeType::TOPIC,
        'routing_keys' => [
            env(key:'APP_NAME', default: 'amqp').'amqp_job.failed'
        ]
    ],
];
```

Get Started
===========

[](#get-started)

publish message in message broker
---------------------------------

[](#publish-message-in-message-broker)

You can access `AMQP` by dependency injection or by using `app(AMQP::class)`.

```
publisher()
        ->dispatch(message: "test message", properties: [])
        ->onQueue(queue: new FirstQueue);
    }
}
```

You need create `FirstQueue` with following content.

```
 **Note**
>
> If you don't need consume this event, don't set `$callbacks`

subscribe messages and run them
-------------------------------

[](#subscribe-messages-and-run-them)

> **Note**
>
> First of all, it is necessary to update `events` key in `config/amqp.php` file and create a class with the same path

```
 \App\Http\Controllers\AMQP\Consumers\Consumers::class,
    ...
];
```

```
getBody(),
			// $event->getChannel(),
			$event->getConsumerTag(),
			$event->getExchange(),
			$event->getRoutingKey(),
			$event->get_properties()
		);
	}
}
```

Enter the following command to run the subscription.

```
php artisan consume
```

Driver Supports:
================

[](#driver-supports)

1. RabbitMQ

Comming Soon
============

[](#comming-soon)

- Kafka
- Pulsar

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community6

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

Every ~24 days

Total

4

Last Release

1141d ago

### Community

Maintainers

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

---

Top Contributors

[![vkoori](https://avatars.githubusercontent.com/u/9253797?v=4)](https://github.com/vkoori "vkoori (18 commits)")

---

Tags

rabbitmqAMQPmessage-broker

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[bschmitt/laravel-amqp

AMQP wrapper for Laravel and Lumen to publish and consume messages

2822.5M7](/packages/bschmitt-laravel-amqp)[php-amqplib/rabbitmq-bundle

Integrates php-amqplib with Symfony &amp; RabbitMq. Formerly emag-tech-labs/rabbitmq-bundle, oldsound/rabbitmq-bundle.

1.3k20.9M69](/packages/php-amqplib-rabbitmq-bundle)[php-amqplib/thumper

AMQP Tools

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

AMQP Tools

27783.6k3](/packages/videlalvaro-thumper)[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.

74272.6k1](/packages/mikemadisonweb-yii2-rabbitmq)[hyperf/amqp

A amqplib for hyperf.

231.3M70](/packages/hyperf-amqp)

PHPackages © 2026

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