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

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

andares/laravel-queue-rabbitmq
==============================

RabbitMQ driver for Laravel Queue. Supports Laravel Horizon. Modified by A.M

01.1k1PHP

Since Nov 20Pushed 6y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)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)

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 using Laravel auto-discovery.

Setup connection in `config/queue.php`

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

        'driver' => 'rabbitmq',

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

        'dsn' => env('RABBITMQ_DSN', null),

        /*
         * Could be one a class that implements \Interop\Amqp\AmqpConnectionFactory for example:
         *  - \EnqueueAmqpExt\AmqpConnectionFactory if you install enqueue/amqp-ext
         *  - \EnqueueAmqpLib\AmqpConnectionFactory if you install enqueue/amqp-lib
         *  - \EnqueueAmqpBunny\AmqpConnectionFactory if you install enqueue/amqp-bunny
         */

        'factory_class' => Enqueue\AmqpLib\AmqpConnectionFactory::class,

        'host' => env('RABBITMQ_HOST', '127.0.0.1'),
        'port' => env('RABBITMQ_PORT', 5672),

        'vhost' => env('RABBITMQ_VHOST', '/'),
        'login' => env('RABBITMQ_LOGIN', 'guest'),
        'password' => env('RABBITMQ_PASSWORD', 'guest'),

        'queue' => env('RABBITMQ_QUEUE', 'default'),

        'options' => [

            'exchange' => [

                'name' => env('RABBITMQ_EXCHANGE_NAME'),

                /*
                 * Determine if exchange should be created if it does not exist.
                 */

                'declare' => env('RABBITMQ_EXCHANGE_DECLARE', true),

                /*
                 * Read more about possible values at https://www.rabbitmq.com/tutorials/amqp-concepts.html
                 */

                'type' => env('RABBITMQ_EXCHANGE_TYPE', \Interop\Amqp\AmqpTopic::TYPE_DIRECT),
                'passive' => env('RABBITMQ_EXCHANGE_PASSIVE', false),
                'durable' => env('RABBITMQ_EXCHANGE_DURABLE', true),
                'auto_delete' => env('RABBITMQ_EXCHANGE_AUTODELETE', false),
                'arguments' => env('RABBITMQ_EXCHANGE_ARGUMENTS'),
            ],

            'queue' => [

                /*
                 * Determine if queue should be created if it does not exist.
                 */

                'declare' => env('RABBITMQ_QUEUE_DECLARE', true),

                /*
                 * Determine if queue should be binded to the exchange created.
                 */

                'bind' => env('RABBITMQ_QUEUE_DECLARE_BIND', true),

                /*
                 * Read more about possible values at https://www.rabbitmq.com/tutorials/amqp-concepts.html
                 */

                'passive' => env('RABBITMQ_QUEUE_PASSIVE', false),
                'durable' => env('RABBITMQ_QUEUE_DURABLE', true),
                'exclusive' => env('RABBITMQ_QUEUE_EXCLUSIVE', false),
                'auto_delete' => env('RABBITMQ_QUEUE_AUTODELETE', false),
                'arguments' => env('RABBITMQ_QUEUE_ARGUMENTS'),
            ],
        ],

        /*
         * Determine the number of seconds to sleep if there's an error communicating with rabbitmq
         * If set to false, it'll throw an exception rather than doing the sleep for X seconds.
         */

        'sleep_on_error' => env('RABBITMQ_ERROR_SLEEP', 5),

        /*
         * Optional SSL params if an SSL connection is used
         * Using an SSL connection will also require to configure your RabbitMQ to enable SSL. More details can be founds here: https://www.rabbitmq.com/ssl.html
         */

        'ssl_params' => [
            'ssl_on' => env('RABBITMQ_SSL', false),
            '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),
        ],

    ],
    // ...
],
```

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 7.4, 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);
```

Using other AMQP transports
---------------------------

[](#using-other-amqp-transports)

The package uses [enqueue/amqp-lib](https://github.com/php-enqueue/enqueue-dev/blob/master/docs/transport/amqp_lib.md) transport which is based on [php-amqplib](https://github.com/php-amqplib/php-amqplib). There is possibility to use any [amqp interop](https://github.com/queue-interop/queue-interop#amqp-interop) compatible transport, for example `enqueue/amqp-ext` or `enqueue/amqp-bunny`. Here's an example on how one can change the transport to `enqueue/amqp-bunny`.

First, install desired transport package:

```
composer require enqueue/amqp-bunny:^0.8
```

Change the factory class in `config/queue.php`:

```
    // ...
    'connections' => [
        'rabbitmq' => [
            'driver' => 'rabbitmq',
            'factory_class' => Enqueue\AmqpBunny\AmqpConnectionFactory::class,
        ],
    ],
```

Testing
-------

[](#testing)

Setup RabbitMQ using `docker-compose`:

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

Run tests:

```
composer test
```

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

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8d0841c58f031bff9021c95e2e3d11e218545674e100b757ede81335bf5aa714?d=identicon)[andares](/maintainers/andares)

---

Top Contributors

[![andares](https://avatars.githubusercontent.com/u/7556505?v=4)](https://github.com/andares "andares (2 commits)")

### Embed Badge

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

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

###  Alternatives

[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.3M26](/packages/league-geotools)[amphp/parser

A generator parser to make streaming parsers simple.

14952.8M16](/packages/amphp-parser)[amphp/serialization

Serialization tools for IPC and data storage in PHP.

13451.1M18](/packages/amphp-serialization)[enqueue/enqueue

Message Queue Library

19820.0M56](/packages/enqueue-enqueue)[deliciousbrains/wp-background-processing

WP Background Processing can be used to fire off non-blocking asynchronous requests or as a background processing tool, allowing you to queue tasks.

1.1k409.8k6](/packages/deliciousbrains-wp-background-processing)[react/async

Async utilities and fibers for ReactPHP

2238.8M171](/packages/react-async)

PHPackages © 2026

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