PHPackages                             arus/amqp-bridge - 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. arus/amqp-bridge

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

arus/amqp-bridge
================

Bridge to AMQP extension for PHP 7.1+ (incl. PHP 8) with support for annotations and JSON Schema

v1.0.2(4y ago)1528MITPHPPHP ^7.1|^8.0

Since Mar 1Pushed 4y ago2 watchersCompare

[ Source](https://github.com/autorusltd/amqp-bridge)[ Packagist](https://packagist.org/packages/arus/amqp-bridge)[ Docs](https://github.com/autorusltd/amqp-bridge)[ RSS](/packages/arus-amqp-bridge/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (3)Dependencies (5)Versions (6)Used By (0)

Bridge to AMQP extension for PHP 7.1+ (incl. PHP 8) with support for annotations and Json Schema
================================================================================================

[](#bridge-to-amqp-extension-for-php-71-incl-php-8-with-support-for-annotations-and-json-schema)

[![Build Status](https://camo.githubusercontent.com/78c9616d93f92c4a484fe4e559a373988b416caec4f43f4652ea487732e32901/68747470733a2f2f636972636c6563692e636f6d2f67682f6175746f7275736c74642f616d71702d6272696467652e7376673f7374796c653d736869656c64)](https://circleci.com/gh/autorusltd/amqp-bridge)[![Code Coverage](https://camo.githubusercontent.com/46b74da020c1dafd2b11b2b682fbaf9a8e3a51ade36e49ad250eeddf85c38f05/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6175746f7275736c74642f616d71702d6272696467652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/autorusltd/amqp-bridge/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/2fe5a45c5ade35524b88be20136707c3a75a58365cbbd0301d7539f35514d7cc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6175746f7275736c74642f616d71702d6272696467652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/autorusltd/amqp-bridge/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/a9d0e0d15faaef70d9ae43bd6390f8ebbe54bdbae59ef34e3b6d11a2f603720f/68747470733a2f2f706f7365722e707567782e6f72672f617275732f616d71702d6272696467652f646f776e6c6f6164733f666f726d61743d666c6174)](https://packagist.org/packages/arus/amqp-bridge)[![Latest Stable Version](https://camo.githubusercontent.com/f2b503b4f5b68480e7c1ae3a014f509c70ada778e17bc7e359c909fd29d0a2e6/68747470733a2f2f706f7365722e707567782e6f72672f617275732f616d71702d6272696467652f762f737461626c653f666f726d61743d666c6174)](https://packagist.org/packages/arus/amqp-bridge)[![License](https://camo.githubusercontent.com/f8513f86a06978a307fbe04fbbd5358ac66d9c50f7d914539dc9a875c2100042/68747470733a2f2f706f7365722e707567782e6f72672f617275732f616d71702d6272696467652f6c6963656e73653f666f726d61743d666c6174)](https://packagist.org/packages/arus/amqp-bridge)

---

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

[](#installation)

```
composer require 'arus/amqp-bridge'
```

QuickStart
----------

[](#quickstart)

#### Queue Message Handler

[](#queue-message-handler)

```
declare(strict_types=1);

namespace App\QueueMessageHandler;

use Arus\AMQP\Bridge\PayloadDecoder\JsonDecoder;
use Arus\AMQP\Bridge\MessageHandlerInterface;
use Arus\AMQP\Bridge\MessageInterface;

use const JSON_OBJECT_AS_ARRAY;

/**
 * @JsonSchemaReference("config/json-schemas/SomeQueueMessage.json")
 */
final class SomeQueueMessageHandler implements MessageHandlerInterface
{

    /**
     * {@inheritDoc}
     */
    public function handle(MessageInterface $message) : void
    {
        $data = (new JsonDecoder)->decode($message, JSON_OBJECT_AS_ARRAY);

        // some code...
    }
}
```

#### Message Queue Consumer

[](#message-queue-consumer)

```
use App\QueueMessageHandler\SomeQueueMessageHandler;
use Arus\AMQP\Bridge\Consumer;

$connection = new AMQPConnection();
$connection->setHost('localhost');
$connection->setPort(5672);
$connection->setVhost('/');
$connection->setLogin('guest');
$connection->setPassword('guest');
$connection->connect();

$channel = new AMQPChannel($connection);
$channel->setPrefetchCount(100);

$queue = new AMQPQueue($channel);
$queue->setName('queue.name');

// init the message queue consumer...
$consumer = new Consumer(new SomeQueueMessageHandler());
// [optional] set a logger based on PSR-3...
$consumer->setLogger($logger);
// [optional] set a custom payload validator...
$consumer->setPayloadValidator($payloadValidator);
// [optional] set a custom annotation reader...
$consumer->setAnnotationReader($annotationReader);
// [optional] use a JSON schema validator for queue messages...
$consumer->useJsonSchemaValidator();
// [optional] set a callback that will be called when a queue message is received...
$consumer->setMessageReceivedCallback(function ($message) {
    // here you can, for example, re-open doctrine entity managers...
});
// [optional] set a callback that will be called when a queue message is handled...
$consumer->setMessageHandledCallback(function ($message) {
    // here you can, for example, clear doctrine entity managers...
});

try {
    $queue->consume($consumer);
} catch (Throwable $e) {
    $connection->disconnect();

    throw $e;
}
```

Acknowledge, reject and requeue commands
----------------------------------------

[](#acknowledge-reject-and-requeue-commands)

- If a queue message was handled **without errors**, such a message will be **automatically acknowledged**;
- If a queue message contains **undecodable** or **invalid** payload, such a message will be **automatically rejected**;
- If a queue message was handled with **an unexpected error**, such a message will be **automatically requeued**;
- If you need to **reject a queue message in code**, just throw an exception `Arus\AMQP\Bridge\Exception\UnacknowledgableQueueMessageExceptionInterface`.

---

Test run
--------

[](#test-run)

```
composer test
```

---

Useful links
------------

[](#useful-links)

-

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 93.3% 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 ~95 days

Total

3

Last Release

1714d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2872934?v=4)[Anatolii Nekhai](/maintainers/fenric)[@fenric](https://github.com/fenric)

---

Top Contributors

[![fenric](https://avatars.githubusercontent.com/u/2872934?v=4)](https://github.com/fenric "fenric (28 commits)")[![MartinDugin](https://avatars.githubusercontent.com/u/54453955?v=4)](https://github.com/MartinDugin "MartinDugin (2 commits)")

---

Tags

amqpconsumerphp7php8json-schemaannotationsAMQPconsumerPHP7php8fenricarus

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/arus-amqp-bridge/health.svg)

```
[![Health](https://phpackages.com/badges/arus-amqp-bridge/health.svg)](https://phpackages.com/packages/arus-amqp-bridge)
```

###  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)[enqueue/enqueue

Message Queue Library

19820.0M56](/packages/enqueue-enqueue)[swarrot/swarrot

A simple lib to consume RabbitMQ queues

3654.4M8](/packages/swarrot-swarrot)[prolic/humus-amqp

PHP-AMQP library with RabbitMQ Extensions

76205.4k5](/packages/prolic-humus-amqp)[sunrise/vin

VIN decoder for PHP 7.1+ based on ISO-3779

83127.0k](/packages/sunrise-vin)[hyperf/amqp

A amqplib for hyperf.

241.2M56](/packages/hyperf-amqp)

PHPackages © 2026

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