PHPackages                             mookofe/tail - 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. mookofe/tail

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

mookofe/tail
============

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

v1.0.5(9y ago)5252.9k↑26.7%19[13 issues](https://github.com/mookofe/tail/issues)[2 PRs](https://github.com/mookofe/tail/pulls)MITPHPPHP &gt;=5.4.7

Since Jul 6Pushed 6y ago4 watchersCompare

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

READMEChangelogDependencies (4)Versions (8)Used By (0)

mookofe/tail
============

[](#mookofetail)

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

[![Build Status](https://camo.githubusercontent.com/6fda66c204f0eaf8036f69d2f19904dcc023e248df788094b7a5e82d6940db44/68747470733a2f2f7472617669732d63692e6f72672f6d6f6f6b6f66652f7461696c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mookofe/tail)[![Latest Stable Version](https://camo.githubusercontent.com/edf42270f363b99a7b11721682c7c72ee6f3eba1f13ca3236c7993691c2e052c/68747470733a2f2f706f7365722e707567782e6f72672f6d6f6f6b6f66652f7461696c2f762f737461626c652e737667)](https://packagist.org/packages/mookofe/tail)[![License](https://camo.githubusercontent.com/95676346e7a82ff266a1484ddde0dae97b270e3ef7fda609ce76f1d2725e3589/68747470733a2f2f706f7365722e707567782e6f72672f6d6f6f6b6f66652f7461696c2f6c6963656e73652e737667)](https://packagist.org/packages/mookofe/tail)

Features
--------

[](#features)

- Simple queue configuration
- Multiple server connections
- Add message to queues easily
- Listen queues with useful options

Requirements
------------

[](#requirements)

- php-amqplib/php-amqplib: 2.\*

Version
-------

[](#version)

1.0.5

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

[](#installation)

**Preparation**

Open your composer.json file and add the following to the require array:

```
"mookofe/tail": "1.*"
```

**Install dependencies**

```
$ composer install

```

Or

```
$ composer update
```

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

[](#integration)

### Laravel

[](#laravel)

After installing the package, open your Laravel config file **config/app.php** and add the following lines.

In the $providers array add the following service provider for this package.

```
Mookofe\Tail\ServiceProvider::class,
```

In the $aliases array add the following facade for this package.

```
'Tail' => Mookofe\Tail\Facades\Tail::class,
```

Add servers connection file running:

```
$ php artisan vendor:publish --provider="Mookofe\Tail\ServiceProvider" --tag="config"
```

### Lumen

[](#lumen)

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

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

//...

$app->configure('tail-settings');
$app->register(Mookofe\Tail\LumenServiceProvider::class);

//...
```

Make sure sure `$app->withFacades();` is uncomment in your **bootstrap/app.php** file

Create a **config** folder in the root directory of your Lumen application and copy the content from **vendor/mookofe/tail/config/tail.php** to **config/tail-settings.php**.

RabbitMQ Connections
--------------------

[](#rabbitmq-connections)

By default the library will use the RabbitMQ installation credentials (on a fresh installation the user "guest" is created with password "guest").

To override the default connection or add more servers, edit the RabbitMQ connections file at: **config/tail-settings.php**

```
return array(

    'default' => 'default_connection',

    'connections' => array(

        'default_connection' => array(
            'host'                => 'localhost',
            'port'                => 5672,
            'username'            => 'guest',
            'password'            => 'guest',
            'vhost'               => '/',
            'ssl_context_options' => null,
            'connection_timeout'  => 3,
            'read_write_timeout'  => 50,   //should be at least 2x heartbeat (if using heartbeat)
            'keepalive'           => true, //requires php-amqplib v2.4.1+
            'heartbeat'           => 25,   //requires php-amqplib v2.4.1+
            'exchange'            => 'default_exchange_name',
            'consumer_tag'        => 'consumer',
            'exchange_type'       => 'direct',
            'content_type'        => 'text/plain'
        ),
        'other_server' => array(
            'host'                => '192.168.0.10',
            'port'                => 5672,
            'username'            => 'guest',
            'password'            => 'guest',
            'vhost'               => '/',
            'ssl_context_options' => array(
                'capath'      => '/etc/ssl/certs',
                'cafile'      => './startssl_ca.pem',
                'verify_peer' => true,
            ),
            'connection_timeout'  => 3.0,
            'read_write_timeout'  => 3.0,
            'keepalive'           => false,
            'heartbeat'           => 0,
            'exchange'            => 'default_exchange_name',
            'consumer_tag'        => 'consumer',
            'exchange_type'       => 'fanout',
            'content_type'        => 'application/json'
        ),
    ),
);
```

Adding messages to queue:
-------------------------

[](#adding-messages-to-queue)

**Adding a simple message**

```
    Tail::add('queue-name', 'message');
```

**Adding message changing RabbitMQ server**

```
    Tail::add('queue-name', 'message', array('connection_name' => 'connection_name_config_file'));
```

**Adding message with different exchange**

```
    Tail::add('queue-name', 'message', array('exchange' => 'exchange_name'));
```

**Adding message with different content type**

```
    Tail::add('queue-name', '{ 'message' : 'message' }', array('content_type' => 'application/json'));
```

**Adding message with different options**

```
	$options = array (
		'connection_name' => 'connection_name_config_file',
		'exchange' => 'exchange_name',
		'vhost' => 'vhost'
	);

    Tail::add('queue-name', 'message', $options);
```

**Using Tail object**

```
	$message = new Tail::createMessage;
	$message->queue_name = 'queue-name';
	$message->message = 'message';
	$message->connection_name = 'connection_name_in_config_file';
	$message->exchange = 'exchange_name';
	$message->vhost = 'vhost';
	$message->content_type = 'content/type'

	$message->save();
```

Listening queues:
-----------------

[](#listening-queues)

**Closure based listener**

```
Tail::listen('queue-name', function ($message) {

	//Your message logic code
});
```

**Closure listener with options**

```
$options = array(
	'message_limit' => 50,
	'time' => 60,
	'empty_queue_timeout' => 5,
	'connection_name' => 'connection_name_in_config_file',
    'exchange' => 'exchange_name',
    'vhost' => 'vhost'
);

Tail::listenWithOptions('queue-name', $options, function ($message) {

	//Your message logic code
});
```

**Options definitions:**

NameDescriptionDefault valuequeue\_nameQueue name on RabbitMQ\* Requiredmessage\_limitNumber of messages to be processed0: UnlimitedtimeTime in seconds the process will be running0: Unlimitedempty\_queue\_timeoutTime in seconds to kill listening when the queue is empty0: Unlimitedconnection\_nameServer connection nameDefined at connections fileexchangeExchange name on RabbitMQ ServerSpecified on connections filevhostVirtual host on RabbitMQ ServerSpecified on connections fileBy default the listen process will be running forever unless you specify one of the running time arguments above (message\_limit, time, empty\_queue\_timeout). They can be mixed all together, so when one of the condition is met the process will be stopped.

License
-------

[](#license)

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

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 91.1% 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 ~78 days

Recently: every ~97 days

Total

6

Last Release

3626d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5992624a8b9b9892f1c5cac6a8661205f00c1bd787343b77e0d1f128dcea3fac?d=identicon)[mookofe](/maintainers/mookofe)

---

Top Contributors

[![mookofe](https://avatars.githubusercontent.com/u/2395540?v=4)](https://github.com/mookofe "mookofe (41 commits)")[![MartinHilscher](https://avatars.githubusercontent.com/u/18195854?v=4)](https://github.com/MartinHilscher "MartinHilscher (3 commits)")[![M4rcDev](https://avatars.githubusercontent.com/u/19869755?v=4)](https://github.com/M4rcDev "M4rcDev (1 commits)")

---

Tags

clientlaravelpackagelibraryqueuerabbitmqlaravel5Victor Cruzmookofe

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mookofe-tail/health.svg)

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

###  Alternatives

[bschmitt/laravel-amqp

AMQP wrapper for Laravel and Lumen to publish and consume messages

2822.5M7](/packages/bschmitt-laravel-amqp)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

44855.7k](/packages/harris21-laravel-fuse)[convenia/pigeon

3334.8k](/packages/convenia-pigeon)

PHPackages © 2026

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