PHPackages                             asmblah/php-amqp-compat - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. asmblah/php-amqp-compat

ActiveProject[Utility &amp; Helpers](/categories/utility)

asmblah/php-amqp-compat
=======================

v0.4.13(1y ago)29.9k↓16.7%[1 PRs](https://github.com/asmblah/php-amqp-compat/pulls)5MITPHPPHP &gt;=8.1CI passing

Since Sep 1Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/asmblah/php-amqp-compat)[ Packagist](https://packagist.org/packages/asmblah/php-amqp-compat)[ RSS](/packages/asmblah-php-amqp-compat/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (10)Versions (25)Used By (5)

PHP AMQP-Compat.
================

[](#php-amqp-compat)

[![Build Status](https://github.com/asmblah/php-amqp-compat/workflows/CI/badge.svg)](https://github.com/asmblah/php-amqp-compat/actions?query=workflow%3ACI)

[php-amqp/ext-amqp](https://github.com/php-amqp/php-amqp) compatibility using [php-amqplib](https://github.com/php-amqplib/php-amqplib).

Why?
----

[](#why)

`php-amqp`/`librabbitmq` does not fully support [AMQP heartbeats](https://www.rabbitmq.com/heartbeats.html), they are only supported during [blocking calls into the extension](https://github.com/php-amqp/php-amqp/tree/v1.11.0#persistent-connection).

### Heartbeat sender

[](#heartbeat-sender)

With `php-amqplib`, we're able to send heartbeats more regularly, in multiple ways:

1. Using a [ReactPHP](https://reactphp.org/) [EventLoop](https://github.com/reactphp/event-loop) with [Envoylope EventLoop](https://github.com/envoylope/event-loop) (recommended).
2. Using [UNIX System V signals](https://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/signals.html) with [Envoylope ext-pcntl](https://github.com/envoylope/pcntl).

See the usage instructions for the packages above for installation.

Usage
-----

[](#usage)

First, remove `ext-amqp` - it cannot be used at the same time as this compatibility layer. Usually, this will be with PECL:

```
$ pecl uninstall amqp
```

> This is because the classes installed in the global/root namespace such as `AMQPConnection`would conflict.

Second, install this package with Composer:

```
$ composer require asmblah/php-amqp-compat
```

Lastly, install the relevant [heartbeat sender](#heartbeat-sender), if required.

That should be all the changes required - this userland library is designed as a drop-in replacement.

Limitations
-----------

[](#limitations)

- Persistent connections are not and cannot be supported from userland.
- If existing logic is checking for the `amqp` extension via `extension_loaded('amqp')`, it will fail because this library does not define an extension. During functional testing, `extension_loaded(...)` is hooked using [PHP Code Shift](https://github.com/asmblah/php-code-shift)to allow running tests from the reference implementation [php-amqp/ext-amqp](https://github.com/php-amqp/php-amqp), see [ReferenceImplementationTest](tests/Functional/Reference/ReferenceImplementationTest.php).

See also
--------

[](#see-also)

- The original php-amqp extension that this compatibility layer replaces: [php-amqp/ext-amqp](https://github.com/php-amqp/php-amqp).
- `php-amqplib`, which this library uses under the hood: [php-amqplib](https://github.com/php-amqplib/php-amqplib).

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance46

Moderate activity, may be stable

Popularity28

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~15 days

Total

22

Last Release

670d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5f40d7540e88cf43038b45f972b0f62231d53dc8400d1c532208ca1c9b125236?d=identicon)[asmblah](/maintainers/asmblah)

---

Top Contributors

[![asmblah](https://avatars.githubusercontent.com/u/1714005?v=4)](https://github.com/asmblah "asmblah (103 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/asmblah-php-amqp-compat/health.svg)

```
[![Health](https://phpackages.com/badges/asmblah-php-amqp-compat/health.svg)](https://phpackages.com/packages/asmblah-php-amqp-compat)
```

###  Alternatives

[wallabag/wallabag

open source self hostable read-it-later web application

12.6k2.2k](/packages/wallabag-wallabag)[ecotone/ecotone

Supporting you in building DDD, CQRS, Event Sourcing applications with ease.

558549.8k17](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[j0k3r/php-readability

Automatic article extraction from HTML

186808.8k6](/packages/j0k3r-php-readability)[symfony/ai-platform

PHP library for interacting with AI platform provider.

51927.7k136](/packages/symfony-ai-platform)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)

PHPackages © 2026

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