PHPackages                             jaapieaapie1/rabbitmq-ext - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. jaapieaapie1/rabbitmq-ext

ActivePhp-ext[HTTP &amp; Networking](/categories/http)

jaapieaapie1/rabbitmq-ext
=========================

A PHP extension for RabbitMQ, written in Rust using ext-php-rs and lapin

1.0.0(2mo ago)012↓90%MITRustPHP &gt;=8.1CI passing

Since Mar 30Pushed 2mo agoCompare

[ Source](https://github.com/jaapieaapie1/rabbitmq-ext)[ Packagist](https://packagist.org/packages/jaapieaapie1/rabbitmq-ext)[ RSS](/packages/jaapieaapie1-rabbitmq-ext/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (10)Dependencies (1)Versions (12)Used By (0)

RabbitMQ-ext
============

[](#rabbitmq-ext)

A PHP extension for consuming RabbitMQ queues, written in Rust using [ext-php-rs](https://github.com/davidcole1340/ext-php-rs)and [lapin](https://github.com/amqp-rs/lapin).

Why
---

[](#why)

The benefit of this approach compared to implementing an RabbitMQ client in PHP is that we can multithread and thus keep sending heartbeats even though the php process is busy doing other things.
This makes it so the connection stays open even when you are processing a job that takes 30 minutes.

Support
-------

[](#support)

This package officially supports and is tested against PHP 8.1 - 8.5.

Installing
----------

[](#installing)

To install the extension use PHP's official extension installer PIE. The extension is [published on packagist](https://packagist.org/packages/jaapieaapie1/rabbitmq-ext).
For most architecture php combinations prebuilt binaries are available (only PIE version &gt; 1.4 supports downloading prebuilt binaries)
If your specific setup is not prebuilt [Rust's buildtools](https://rustup.rs/)are required to build this library.

```
pie install jaapieaapie1/rabbitmq-ext
```

For IDE's and PHPStan there are stubs available as a [composer package](https://packagist.org/packages/jaapieaapie1/rabbitmq-ext-stubs).

```
composer require --dev jaapieaapie1/rabbitmq-ext-stubs
```

Usage
-----

[](#usage)

### Consuming messages

[](#consuming-messages)

```
use RabbitMQ\Connection;

$connection = new Connection('amqp://guest:guest@localhost:5672');
$consumer = $connection->consume('my-queue', prefetchCount: 50);

$consumer->each(function ($message) {
    echo $message->getBody() . PHP_EOL;

    $message->ack();

    return true; // return false to stop consuming
});

$connection->close();
```

### Consuming with a timeout

[](#consuming-with-a-timeout)

```
$consumer = $connection->consume('my-queue');

while ($message = $consumer->next(timeoutMs: 5000)) {
    echo $message->getRoutingKey() . ': ' . $message->getBody() . PHP_EOL;
    $message->ack();
}

// null returned — timed out or consumer was cancelled
$connection->close();
```

### Publishing messages

[](#publishing-messages)

```
$connection = new Connection('amqp://guest:guest@localhost:5672');

// Publish and wait for broker confirmation
$connection->publish('my-exchange', 'routing.key', '{"event":"order.created"}', [
    'x-request-id' => 'abc-123',
]);

// Fire-and-forget (confirmed before connection closes)
$connection->publishAsync('my-exchange', 'routing.key', 'payload');

$connection->close();
```

### Handling failures

[](#handling-failures)

```
$consumer = $connection->consume('my-queue');

$consumer->each(function ($message) {
    try {
        processMessage($message->getBody());
        $message->ack();
    } catch (\Throwable $e) {
        $message->nack(requeue: false); // dead-letter the message
    }

    return true;
});
```

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance83

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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 ~0 days

Total

10

Last Release

88d ago

Major Versions

0.2.2 → 1.0.02026-04-03

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/63400965?v=4)[Jaap Elst](/maintainers/jaapieaapie1)[@jaapieaapie1](https://github.com/jaapieaapie1)

---

Top Contributors

[![jaapieaapie1](https://avatars.githubusercontent.com/u/63400965?v=4)](https://github.com/jaapieaapie1 "jaapieaapie1 (18 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/jaapieaapie1-rabbitmq-ext/health.svg)

```
[![Health](https://phpackages.com/badges/jaapieaapie1-rabbitmq-ext/health.svg)](https://phpackages.com/packages/jaapieaapie1-rabbitmq-ext)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25025.5M80](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.2M6.6k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k20.0k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87930.4k113](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.3M84](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69122.6k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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