PHPackages                             evaneos/burrow - 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. evaneos/burrow

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

evaneos/burrow
==============

AMQP Messaging Event component

v4.6.0(4y ago)3104.2k↓33.3%1[3 issues](https://github.com/Evaneos/Burrow/issues)4MITPHPPHP &gt;=5.5.9

Since Jan 19Pushed 4y ago22 watchersCompare

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

READMEChangelog (10)Dependencies (13)Versions (32)Used By (4)

Burrow
======

[](#burrow)

[![Build Status](https://camo.githubusercontent.com/2aeae2baf14f63e53a75783d4be09886ec7e74cea3da9c83ea56dc1578dab23e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4576616e656f732f427572726f772f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Evaneos/Burrow/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/ccbb2fc077e4f49b985f1758b00ca312ab4fce81d32757568c1e5eda9a7c56fe/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4576616e656f732f427572726f772f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Evaneos/Burrow/?branch=master)[![Packagist Version](https://camo.githubusercontent.com/6d1f0de0b85925b9aaf9634c1bcf5bfbed6b80cbbfec05d36880ae194c574067/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6576616e656f732f627572726f772e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/evaneos/burrow)[![Code Coverage](https://camo.githubusercontent.com/682aa0290e0ed7ae05b53e97d14340f8addc68a83b55e24cdb2f312b47648da4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4576616e656f732f427572726f772f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Evaneos/Burrow/?branch=master)

Evaneos AMQP library able to use both [php-amqplib](https://github.com/php-amqplib/php-amqplib)and [pecl amqp C librairy](https://github.com/pdezwart/php-amqp)

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

[](#installation)

```
composer require evaneos/burrow
```

Usage
-----

[](#usage)

See examples directory for more details
To test it, you may use a rabbitmq container, this one feets perfectly

```
docker run -d -p 5672:5672 rabbitmq
```

### Declare an exchange and bind a queue with RabbitMQ

[](#declare-an-exchange-and-bind-a-queue-with-rabbitmq)

```
$admin = DriverFactory::getDriver([
    'host' => 'localhost',
    'port' => '5672',
    'user' => 'guest',
    'pwd' => 'guest'
]);
$admin->declareExchange('exchange');
$admin->declareAndBindQueue('exchange', 'my_queue');
```

Asynchronous management
-----------------------

[](#asynchronous-management)

#### Dispatching an async message with RabbitMQ

[](#dispatching-an-async-message-with-rabbitmq)

```
$driver = DriverFactory::getDriver([
    'host' => 'localhost',
    'port' => '5672',
    'user' => 'guest',
    'pwd' => 'guest'
]);
$publisher = new AsyncPublisher($driver, 'exchange');
$publisher->publish('message', 'routing_key', [ 'meta' => 'data' ]);
```

#### Write a daemon to consume async messages from RabbitMQ

[](#write-a-daemon-to-consume-async-messages-from-rabbitmq)

```
$driver = DriverFactory::getDriver([
    'host' => 'default',
    'port' => '5672',
    'user' => 'guest',
    'pwd' => 'guest'
]);
$handlerBuilder = new HandlerBuilder($driver);
$handler = $handlerBuilder->async()->build(new EchoConsumer());
$daemon = new QueueHandlingDaemon($driver, $handler, 'test');
$worker = new Worker($daemon);
$worker->run();
```

In the command-line, launch both scripts from a different terminal, the message 'my\_message', should be displayed in the worker terminal.

Synchronous management
----------------------

[](#synchronous-management)

#### Dispatching an async message with RabbitMQ

[](#dispatching-an-async-message-with-rabbitmq-1)

```
$driver = DriverFactory::getDriver([
   'host' => 'default',
   'port' => '5672',
   'user' => 'guest',
   'pwd' => 'guest'
]);
$publisher = new SyncPublisher($driver, 'xchange');
$publisher->publish('my_message', 'routing_key', [ 'meta' => 'data' ]);
```

#### Write a daemon to consume async messages from RabbitMQ

[](#write-a-daemon-to-consume-async-messages-from-rabbitmq-1)

```
$driver = DriverFactory::getDriver([
   'host' => 'default',
   'port' => '5672',
   'user' => 'guest',
   'pwd' => 'guest'
]);

$handlerBuilder = new HandlerBuilder($driver);
$handler = $handlerBuilder->sync()->build(new ReturnConsumer());
$daemon = new QueueHandlingDaemon($driver, $handler, 'test');
$worker = new Worker($daemon);
$worker->run();
```

In the command-line, launch both scripts from a different terminal, the message 'my\_message', should be displayed in the publisher terminal.

Events
------

[](#events)

You can add your emitter to subscribe events:

- [DaemonStart](src/Event/DaemonStarted.php)
- [DaemonStopped](src/Event/DaemonStopped.php)
- [MessageReceived](src/Event/MessageReceived.php)
- [MessageConsumed](src/Event/MessageStopped.php)

```
$emitter = new League\Event\Emitter();
$emitter->addListener(new MyListener());

new QueueHandlingDaemon([..], $emitter);
```

Metrics
-------

[](#metrics)

Based on events, you can subscribe a built-in metric publisher which will send this metrics:

- `daemon.started` (increment)
- `daemon.stopped` (increment)
- `daemon.message_received` (increment)
- `daemon.message_consumed` (increment)
- `daemon.message_processing_time` (timing)

There is an implementation for StatsD and DogStatsD.

```
$config = ['host' => 'host', 'port' => 'port'];

// StatsD
$metricService = MetricServiceFactory::create('statsd', $config);
// DogStatsD
$tags = ['service' => 'myService']; // This tags will be sent with all the metrics
$metricService = MetricServiceFactory::create('dogstats', $config, $tags);

$emitter = new League\Event\Emitter();
$emitter->useListenerProvider(new SendMetricListenerProvider($metricService));

new QueueHandlingDaemon([..], $emitter);
```

Examples
--------

[](#examples)

All these examples are also available in the `example` directory.

Handlers
--------

[](#handlers)

You can now use handlers to modify the consumption behaviour. For retro-compatibility reasons, a `ContinueOnFailureHandler` has been created to reproduce the previous default behaviour. Please, do not use it anymore as it is quite dangerous to allow the worker to continue when receiving an error.

To ease the use of the handlers, please build the handler stack using `HandlerBuilder`.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community25

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 62.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 ~87 days

Recently: every ~255 days

Total

29

Last Release

1686d ago

Major Versions

v1.1.0 → v2.0.02015-05-13

v2.3.0 → v3.0.02016-03-12

v3.4.0 → v4.0.02017-01-11

### Community

Maintainers

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

---

Top Contributors

[![remi-san](https://avatars.githubusercontent.com/u/5213540?v=4)](https://github.com/remi-san "remi-san (56 commits)")[![maffpool](https://avatars.githubusercontent.com/u/4547357?v=4)](https://github.com/maffpool "maffpool (15 commits)")[![moafred](https://avatars.githubusercontent.com/u/1343723?v=4)](https://github.com/moafred "moafred (7 commits)")[![Pol-Valentin](https://avatars.githubusercontent.com/u/2620286?v=4)](https://github.com/Pol-Valentin "Pol-Valentin (4 commits)")[![qpautrat](https://avatars.githubusercontent.com/u/1844413?v=4)](https://github.com/qpautrat "qpautrat (3 commits)")[![yoan-evaneos](https://avatars.githubusercontent.com/u/21684758?v=4)](https://github.com/yoan-evaneos "yoan-evaneos (3 commits)")[![SelrahcD](https://avatars.githubusercontent.com/u/1864786?v=4)](https://github.com/SelrahcD "SelrahcD (1 commits)")

---

Tags

amqpasyncphprabbitmq

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/evaneos-burrow/health.svg)

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

###  Alternatives

[php-amqplib/rabbitmq-bundle

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

1.3k20.1M65](/packages/php-amqplib-rabbitmq-bundle)[magento/community-edition

Magento 2 (Open Source)

12.1k52.1k10](/packages/magento-community-edition)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[orisai/scheduler

Cron job scheduler - with locks, parallelism and more

4037.1k4](/packages/orisai-scheduler)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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