PHPackages                             filld/larabbit - 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. filld/larabbit

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

filld/larabbit
==============

AMQP wrapper for Laravel and Lumen to publish and consume messages

v2.2.0(7y ago)27.5kMITPHPPHP &gt;=5.5.9CI failing

Since Jun 29Pushed 6y ago10 watchersCompare

[ Source](https://github.com/filld/larabbit)[ Packagist](https://packagist.org/packages/filld/larabbit)[ RSS](/packages/filld-larabbit/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (4)Versions (20)Used By (0)

filld/larabbit
==============

[](#filldlarabbit)

AMQP wrapper for Laravel and Lumen to publish and consume messages especially from RabbitMQ

Features
--------

[](#features)

- Advanced queue configuration
- Add message to queues easily
- Listen queues with useful options

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

[](#installation)

### Composer

[](#composer)

Add the following to your require part within the composer.json:

```
"filld/larabbit": "2.*"
```

```
$ php composer update
```

or

```
$ php composer require filld/larabbit

```

Integration
-----------

[](#integration)

### Environment Variables

[](#environment-variables)

The following Env vars need to be set in your `.env` file:

```
RABBITMQ_HOST
RABBITMQ_PORT
RABBITMQ_USERNAME
RABBITMQ_PASSWORD
RABBITMQ_VHOST

# Optional SSL:
RABBITMQ_SSL_CERT_PATH

```

### Lumen

[](#lumen)

Create a **config** folder in the root directory of your Lumen application and copy the content from **vendor/filld/larabbit/config/amqp.php** to **config/amqp.php**.

Adjust the properties to your needs.

```
return [

    'use' => 'production',

    'properties' => [

        'production' => [
            'host'                => env('RABBITMQ_HOST', 'localhost'),
            'port'                => env('RABBITMQ_PORT', 5672),
            'username'            => env('RABBITMQ_USERNAME'),
            'password'            => env('RABBITMQ_PASSWORD'),
            'vhost'               => env('RABBITMQ_VHOST'),
            'exchanges'           => [
                                         [
                                             'exchange'              => 'exchange_name',
                                             'exchange_type'         => 'topic',
                                             'exchange_passive'      => false,
                                             'exchange_durable'      => true,
                                             'exchange_auto_delete'  => false,
                                             'exchange_internal'     => false,
                                             'exchange_nowait'       => false,
                                             'exchange_properties'   => [],

                                             'routing' => [
                                                 'routing.key.one',
                                                 'routing.key.two',
                                         ]
                                     ],
            'consumer_tag'        => 'consumer',
            'ssl_options'         => [], // See https://secure.php.net/manual/en/context.ssl.php
            'connect_options'     => [], // See https://github.com/php-amqplib/php-amqplib/blob/master/PhpAmqpLib/Connection/AMQPSSLConnection.php
            'queue_properties'    => ['x-ha-policy' => ['S', 'all']],
            'timeout'             => 0
        ],

    ],

];
```

Register the Lumen Service Provider in **bootstrap/app.php**:

```
/*
|--------------------------------------------------------------------------
| Register Service Providers
|--------------------------------------------------------------------------
*/

//...

$app->configure('amqp');
$app->register(Filld\Amqp\LumenServiceProvider::class);

//...
```

Enable Facade Support for Lumen 5.2+

```
$app->withFacades();
```

### Laravel

[](#laravel)

Open **config/app.php** and add the service provider and alias:

```
'Filld\Amqp\AmqpServiceProvider',
```

```
'Amqp' => 'Filld\Amqp\Facades\Amqp',
```

Setting up SSL
--------------

[](#setting-up-ssl)

Make sure you copy the CA cert chain to somewhere that you can reference. The `storage/certs` directory is suggested. Also, don't forget to set the SSL settings in the config:

```
'connect_options'     => [
    'capath' => '/etc/ssl/certs',
    'cafile' => env('RABBITMQ_SSL_CERT', storage_path() . '/certs/cacert.pem'),
    'verify_peer' => true
],
```

Also, don't forget that the port likely changed to 5671

Publishing a message
--------------------

[](#publishing-a-message)

### Push message with routing key

[](#push-message-with-routing-key)

```
    Amqp::publish('routing-key', 'message');
```

### Push message with routing key and create queue

[](#push-message-with-routing-key-and-create-queue)

```
    Amqp::publish('routing-key', 'message' , ['queue' => 'queue-name']);
```

### Push message with routing key and overwrite properties

[](#push-message-with-routing-key-and-overwrite-properties)

```
    Amqp::publish('routing-key', 'message' , ['exchange' => 'amq.direct']);
```

Notice that if you attempt to set properties like: `x-message-ttl` you may get an error like the following:

> AMQP-rabbit doesn't define data of type \[\]

You **must** specify a type:

```
    Amqp::publish('routing-key', 'message', [
        'queue_properties' => [
            "x-ha-policy" => ["S", "all"],
            'x-message-ttl' => ['I', 86400000],
            'x-dead-letter-exchange' => ['S', 'orders_dead_letter'],
        ],
        'queue' => 'orders'
    ]);
```

Consuming messages
------------------

[](#consuming-messages)

### Consume messages, acknowledge and stop when no message is left

[](#consume-messages-acknowledge-and-stop-when-no-message-is-left)

```
Amqp::consume('queue-name', function ($message, $resolver) {

   var_dump($message->body);

   $resolver->acknowledge($message);

   $resolver->stopWhenProcessed();

});
```

### Consume messages forever

[](#consume-messages-forever)

```
Amqp::consume('queue-name', function ($message, $resolver) {

   var_dump($message->body);

   $resolver->acknowledge($message);

});
```

### Consume messages, with custom settings

[](#consume-messages-with-custom-settings)

```
Amqp::consume('queue-name', function ($message, $resolver) {

   var_dump($message->body);

   $resolver->acknowledge($message);

}, [
	'timeout' => 2,
	'vhost'   => 'vhost3'
]);
```

Fanout example
--------------

[](#fanout-example)

### Publishing a message

[](#publishing-a-message-1)

```
\Amqp::publish('', 'message' , [
    'exchange_type' => 'fanout',
    'exchange' => 'amq.fanout',
]);
```

### Consuming messages

[](#consuming-messages-1)

```
\Amqp::consume('', function ($message, $resolver) {
    var_dump($message->body);
    $resolver->acknowledge($message);
}, [
    'exchange' => 'amq.fanout',
    'exchange_type' => 'fanout',
    'queue_force_declare' => true,
    'queue_exclusive' => true,
    'persistent' => true// required if you want to listen forever
]);
```

Credits
-------

[](#credits)

- This project is a fork of
- Some concepts were used from

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~63 days

Recently: every ~13 days

Total

17

Last Release

2600d ago

Major Versions

1.4.0 → 2.0.02019-01-29

### Community

Maintainers

![](https://www.gravatar.com/avatar/d8041f21805ca3e5f7b7d8c0980bbc7cc27412235c6dcb1c4832ad08ceec0e91?d=identicon)[russianryebread](/maintainers/russianryebread)

---

Top Contributors

[![bschmitt](https://avatars.githubusercontent.com/u/239644?v=4)](https://github.com/bschmitt "bschmitt (29 commits)")[![russianryebread](https://avatars.githubusercontent.com/u/747085?v=4)](https://github.com/russianryebread "russianryebread (18 commits)")[![SpaceK33z](https://avatars.githubusercontent.com/u/533616?v=4)](https://github.com/SpaceK33z "SpaceK33z (4 commits)")[![njgreb](https://avatars.githubusercontent.com/u/44781230?v=4)](https://github.com/njgreb "njgreb (4 commits)")[![junaidnasir](https://avatars.githubusercontent.com/u/10703810?v=4)](https://github.com/junaidnasir "junaidnasir (3 commits)")[![ni-bschmitt](https://avatars.githubusercontent.com/u/58559970?v=4)](https://github.com/ni-bschmitt "ni-bschmitt (3 commits)")[![hertzigger](https://avatars.githubusercontent.com/u/4991108?v=4)](https://github.com/hertzigger "hertzigger (2 commits)")[![kitepwr](https://avatars.githubusercontent.com/u/1430133?v=4)](https://github.com/kitepwr "kitepwr (1 commits)")[![AidasK](https://avatars.githubusercontent.com/u/2088484?v=4)](https://github.com/AidasK "AidasK (1 commits)")

---

Tags

laravelpackagelumenqueuerabbitmqmessage queueAMQPlaravel5filld

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/filld-larabbit/health.svg)

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

###  Alternatives

[bschmitt/laravel-amqp

AMQP wrapper for Laravel and Lumen to publish and consume messages

2752.3M7](/packages/bschmitt-laravel-amqp)[mookofe/tail

RabbitMQ and PHP client for Laravel and Lumen that allows you to add and listen queues messages just simple

5552.5k](/packages/mookofe-tail)[nuwber/rabbitevents

The Nuwber RabbitEvents package

120515.8k3](/packages/nuwber-rabbitevents)[iamfarhad/laravel-rabbitmq

A robust RabbitMQ driver for Laravel Queue with advanced message queuing, reliable delivery, and high-performance async processing capabilities

3215.6k](/packages/iamfarhad-laravel-rabbitmq)

PHPackages © 2026

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