PHPackages                             hooraweb/laravel-queue-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. hooraweb/laravel-queue-rabbitmq

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

hooraweb/laravel-queue-rabbitmq
===============================

RabbitMQ driver for Laravel Queue. Supports Laravel Horizon.

v10.2.1(6y ago)013MITPHPPHP ^7.2

Since Jan 28Pushed 5y agoCompare

[ Source](https://github.com/hooraweb/laravel-queue-rabbitmq)[ Packagist](https://packagist.org/packages/hooraweb/laravel-queue-rabbitmq)[ RSS](/packages/hooraweb-laravel-queue-rabbitmq/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (7)Versions (55)Used By (0)

RabbitMQ Queue driver for Laravel
=================================

[](#rabbitmq-queue-driver-for-laravel)

[![Latest Stable Version](https://camo.githubusercontent.com/ae35fda6d3cb5b57b8d37357c6952383168d3700e346429ed5246210f4b05a48/68747470733a2f2f706f7365722e707567782e6f72672f766c6164696d69722d79756c6461736865762f6c61726176656c2d71756575652d7261626269746d712f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/vladimir-yuldashev/laravel-queue-rabbitmq)[![Build Status](https://camo.githubusercontent.com/cd7fa6cf0c5d6c472d47c0b7df543cf1822efe48646f8d1e5748841756fce62b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7679756c6461736865762f6c61726176656c2d71756575652d7261626269746d712e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/vyuldashev/laravel-queue-rabbitmq)[![Total Downloads](https://camo.githubusercontent.com/f38a16fd27cfaa1a90e2c6bca3d4b04a9e5d73abb89d388dabc6e4c86354c4bc/68747470733a2f2f706f7365722e707567782e6f72672f766c6164696d69722d79756c6461736865762f6c61726176656c2d71756575652d7261626269746d712f646f776e6c6f6164733f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/vladimir-yuldashev/laravel-queue-rabbitmq)[![StyleCI](https://camo.githubusercontent.com/f60d931ca9314100ec128218fd0d3600c6dcc6517471a84b280d9b4fd511dcbc/68747470733a2f2f7374796c6563692e696f2f7265706f732f31343937363735322f736869656c64)](https://styleci.io/repos/14976752)[![License](https://camo.githubusercontent.com/5d5fd5b6ae3ea751391bfefbbb234e670205414b1ec2a8e06f789a9ee277ea6b/68747470733a2f2f706f7365722e707567782e6f72672f766c6164696d69722d79756c6461736865762f6c61726176656c2d71756575652d7261626269746d712f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/vladimir-yuldashev/laravel-queue-rabbitmq)

Support Policy
--------------

[](#support-policy)

Only the latest version will get new features. Bug fixes will be provided using the following scheme:

Package VersionLaravel VersionBug Fixes Until6.05.5August 30th, 2019[Documentation](https://github.com/vyuldashev/laravel-queue-rabbitmq/blob/v6.0/README.md)7.05.6August 7th, 2018[Documentation](https://github.com/vyuldashev/laravel-queue-rabbitmq/blob/v7.0/README.md)7.15.7March 4th, 2019[Documentation](https://github.com/vyuldashev/laravel-queue-rabbitmq/blob/v7.0/README.md)7.25.8August 26th, 2019[Documentation](https://github.com/vyuldashev/laravel-queue-rabbitmq/blob/v7.0/README.md)8.05.8August 26th, 2019[Documentation](https://github.com/vyuldashev/laravel-queue-rabbitmq/blob/v8.0/README.md)96September 3rd, 2021[Documentation](https://github.com/vyuldashev/laravel-queue-rabbitmq/blob/v9.0/README.md)106, 7September 3rd, 2021[Documentation](https://github.com/vyuldashev/laravel-queue-rabbitmq/blob/master/README.md)Installation
------------

[](#installation)

You can install this package via composer using this command:

```
composer require vladimir-yuldashev/laravel-queue-rabbitmq

```

The package will automatically register itself.

Add connection to `config/queue.php`:

```
'connections' => [
    // ...

    'rabbitmq' => [

       'driver' => 'rabbitmq',
       'queue' => env('RABBITMQ_QUEUE', 'default'),
       'connection' => PhpAmqpLib\Connection\AMQPLazyConnection::class,

       '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', '/'),
           ],
       ],

       'options' => [
           'ssl_options' => [
               'cafile' => env('RABBITMQ_SSL_CAFILE', null),
               'local_cert' => env('RABBITMQ_SSL_LOCALCERT', null),
               'local_key' => env('RABBITMQ_SSL_LOCALKEY', null),
               'verify_peer' => env('RABBITMQ_SSL_VERIFY_PEER', true),
               'passphrase' => env('RABBITMQ_SSL_PASSPHRASE', null),
           ],
       ],

       /*
        * Set to "horizon" if you wish to use Laravel Horizon.
        */
       'worker' => env('RABBITMQ_WORKER', 'default'),

    ],

    // ...
],
```

### Optional Config

[](#optional-config)

Optionally add queue options to the config of a connection. Every queue created for this connection, get's the properties.

When you want to prioritize messages when they were delayed, then this is possible by adding extra options.

- When max-priority is omitted, the max priority is set with 2 when used.

```
'connections' => [
    // ...

    'rabbitmq' => [
        // ...

        'options' => [
            'queue' => [
                // ...

                'prioritize_delayed_messages' =>  false,
                'queue_max_priority' => 10,
            ],
        ],
    ],

    // ...
],
```

When you want to publish messages against an exchange with routing-key's, then this is possible by adding extra options.

- When the exchange is omitted, RabbitMQ will use the `amq.direct` exchange for the routing-key
- When routing-key is omitted the routing-key by default is the `queue` name.
- When using `%s` in the routing-key the queue\_name will be substituted.

> Note: when using exchange with routing-key, u probably create your queues with bindings yourself.

```
'connections' => [
    // ...

    'rabbitmq' => [
        // ...

        'options' => [
            'queue' => [
                // ...

                'exchange' => 'application-x',
                'exchange_type' => 'topic',
                'exchange_routing_key' => '',
            ],
        ],
    ],

    // ...
],
```

In Laravel failed jobs are stored into the database. But maybe you want to instruct some other process to also do something with the message. When you want to instruct RabbitMQ to reroute failed messages to a exchange or a specific queue, then this is possible by adding extra options.

- When the exchange is omitted, RabbitMQ will use the `amq.direct` exchange for the routing-key
- When routing-key is omitted, the routing-key by default the `queue` name is substituted with `'.failed'`.
- When using `%s` in the routing-key the queue\_name will be substituted.

> Note: When using failed\_job exchange with routing-key, u probably need to create your exchange/queue with bindings yourself.

```
'connections' => [
    // ...

    'rabbitmq' => [
        // ...

        'options' => [
            'queue' => [
                // ...

                'reroute_failed' => true,
                'failed_exchange' => 'failed-exchange',
                'failed_routing_key' => 'application-x.%s',
            ],
        ],
    ],

    // ...
],
```

Laravel Usage
-------------

[](#laravel-usage)

Once you completed the configuration you can use Laravel Queue API. If you used other queue drivers you do not need to change anything else. If you do not know how to use Queue API, please refer to the official Laravel documentation:

Laravel Horizon Usage
---------------------

[](#laravel-horizon-usage)

Starting with 8.0, this package supports [Laravel Horizon](http://horizon.laravel.com) out of the box. Firstly, install Horizon and then set `RABBITMQ_WORKER` to `horizon`.

Lumen Usage
-----------

[](#lumen-usage)

For Lumen usage the service provider should be registered manually as follow in `bootstrap/app.php`:

```
$app->register(VladimirYuldashev\LaravelQueueRabbitMQ\LaravelQueueRabbitMQServiceProvider::class);
```

Consuming Messages
------------------

[](#consuming-messages)

There are two ways of consuming messages.

1. `queue:work` command which is Laravel's built-in command. This command utilizes `basic_get`.
2. `rabbitmq:consume` command which is provided by this package. This command utilizes `basic_consume` and is more performant than `basic_get` by ~2x.

Testing
-------

[](#testing)

Setup RabbitMQ using `docker-compose`:

```
docker-compose up -d rabbitmq
```

To run the test suite you can use the following commands:

```
# To run both style and unit tests.
composer test

# To run only style tests.
composer test:style

# To run only unit tests.
composer test:unit
```

If you receive any errors from the style tests, you can automatically fix most, if not all of the issues with the following command:

```
composer fix:style
```

Contribution
------------

[](#contribution)

You can contribute to this package by discovering bugs and opening issues. Please, add to which version of package you create pull request or issue. (e.g. \[5.2\] Fatal error on delayed job)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 79.9% 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 ~44 days

Recently: every ~34 days

Total

53

Last Release

2192d ago

Major Versions

v7.0.x-dev → v8.0.02019-03-27

5.1 → v8.3.02019-07-27

v8.3.0 → v9.0.02019-09-04

v9.0.x-dev → v10.0.02019-12-12

v8.0.x-dev → v10.2.02020-04-24

PHP version history (7 changes)4.0PHP &gt;=5.3.0

v5.0.x-devPHP &gt;=5.4.0

v5.2.x-devPHP &gt;=5.5.9

v5.3.x-devPHP &gt;=5.6.4

5.5PHP &gt;=7.0

v7.1.0PHP ^7.1.3

v9.0.0PHP ^7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4930208?v=4)[omid shojaei](/maintainers/omidshj)[@omidshj](https://github.com/omidshj)

---

Top Contributors

[![vyuldashev](https://avatars.githubusercontent.com/u/1809081?v=4)](https://github.com/vyuldashev "vyuldashev (319 commits)")[![makasim](https://avatars.githubusercontent.com/u/143206?v=4)](https://github.com/makasim "makasim (23 commits)")[![adm-bome](https://avatars.githubusercontent.com/u/11626777?v=4)](https://github.com/adm-bome "adm-bome (9 commits)")[![dustindoiron](https://avatars.githubusercontent.com/u/857244?v=4)](https://github.com/dustindoiron "dustindoiron (6 commits)")[![jlozano254](https://avatars.githubusercontent.com/u/8600559?v=4)](https://github.com/jlozano254 "jlozano254 (3 commits)")[![hex7c0](https://avatars.githubusercontent.com/u/4419146?v=4)](https://github.com/hex7c0 "hex7c0 (3 commits)")[![nicksnellockts](https://avatars.githubusercontent.com/u/15774335?v=4)](https://github.com/nicksnellockts "nicksnellockts (3 commits)")[![AaronJan](https://avatars.githubusercontent.com/u/4630940?v=4)](https://github.com/AaronJan "AaronJan (2 commits)")[![akbarjimi](https://avatars.githubusercontent.com/u/38979273?v=4)](https://github.com/akbarjimi "akbarjimi (2 commits)")[![eupathy](https://avatars.githubusercontent.com/u/6639227?v=4)](https://github.com/eupathy "eupathy (2 commits)")[![jinchan-ck](https://avatars.githubusercontent.com/u/3828494?v=4)](https://github.com/jinchan-ck "jinchan-ck (2 commits)")[![MorrisonHotel](https://avatars.githubusercontent.com/u/767680?v=4)](https://github.com/MorrisonHotel "MorrisonHotel (2 commits)")[![net53](https://avatars.githubusercontent.com/u/34511399?v=4)](https://github.com/net53 "net53 (2 commits)")[![nifrasismail](https://avatars.githubusercontent.com/u/6188636?v=4)](https://github.com/nifrasismail "nifrasismail (2 commits)")[![olissenberg](https://avatars.githubusercontent.com/u/241748520?v=4)](https://github.com/olissenberg "olissenberg (2 commits)")[![omidshj](https://avatars.githubusercontent.com/u/4930208?v=4)](https://github.com/omidshj "omidshj (2 commits)")[![vrubim](https://avatars.githubusercontent.com/u/127127950?v=4)](https://github.com/vrubim "vrubim (2 commits)")[![phalouvas](https://avatars.githubusercontent.com/u/5654203?v=4)](https://github.com/phalouvas "phalouvas (1 commits)")[![serderovsh](https://avatars.githubusercontent.com/u/24723913?v=4)](https://github.com/serderovsh "serderovsh (1 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/hooraweb-laravel-queue-rabbitmq/health.svg)

```
[![Health](https://phpackages.com/badges/hooraweb-laravel-queue-rabbitmq/health.svg)](https://phpackages.com/packages/hooraweb-laravel-queue-rabbitmq)
```

###  Alternatives

[vladimir-yuldashev/laravel-queue-rabbitmq

RabbitMQ driver for Laravel Queue. Supports Laravel Horizon.

2.1k9.8M30](/packages/vladimir-yuldashev-laravel-queue-rabbitmq)[bschmitt/laravel-amqp

AMQP wrapper for Laravel and Lumen to publish and consume messages

2752.3M7](/packages/bschmitt-laravel-amqp)[jwage/phpamqplib-messenger

Symfony messenger transport for the php-amqplib/php-amqplib library.

84149.7k1](/packages/jwage-phpamqplib-messenger)[palpalani/laravel-sqs-queue-json-reader

Custom SQS queue reader for Laravel

26109.8k](/packages/palpalani-laravel-sqs-queue-json-reader)[convenia/pigeon

3233.0k](/packages/convenia-pigeon)

PHPackages © 2026

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