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)211.6k↓39.9%[1 issues](https://github.com/asmblah/php-amqp-compat/issues)[2 PRs](https://github.com/asmblah/php-amqp-compat/pulls)6MITPHPPHP &gt;=8.1CI passing

Since Sep 1Pushed 2w 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 3d ago

READMEChangelogDependencies (10)Versions (26)Used By (6)

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

41

—

FairBetter than 87% of packages

Maintenance58

Moderate activity, may be stable

Popularity28

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity53

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

717d 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

[symfony/lock

Creates and manages locks, a mechanism to provide exclusive access to a shared resource

514139.2M693](/packages/symfony-lock)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

564576.7k53](/packages/ecotone-ecotone)[civicrm/civicrm-core

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

751291.4k43](/packages/civicrm-civicrm-core)[illuminate/broadcasting

The Illuminate Broadcasting package.

7127.2M209](/packages/illuminate-broadcasting)[logiscape/mcp-sdk-php

Model Context Protocol SDK for PHP

368116.8k12](/packages/logiscape-mcp-sdk-php)

PHPackages © 2026

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