PHPackages                             func0der/humus-amqp - 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. func0der/humus-amqp

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

func0der/humus-amqp
===================

PHP-AMQP library with RabbitMQ Extensions

v2.1.1(3y ago)03MITPHPPHP ^7.4 || ^8.0

Since Jun 7Pushed 2y agoCompare

[ Source](https://github.com/func0der/HumusAmqp)[ Packagist](https://packagist.org/packages/func0der/humus-amqp)[ Docs](https://github.com/prolic/HumusAmqp)[ Patreon](https://www.patreon.com/prolic)[ RSS](/packages/func0der-humus-amqp/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (14)Versions (18)Used By (0)

Humus Amqp
==========

[](#humus-amqp)

Please be aware that this is merely a mirror of prolic/humus-amqp. I merely created this copy to publish a newer version of the library to packagist. I do not plan to actively maintain it.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#please-be-aware-that-this-is-merely-a-mirror-of-prolichumus-amqp-i-merely-created-this-copy-to-publish-a-newer-version-of-the-library-to-packagist-i-do-not-plan-to-actively-maintain-it)

PHP 7.4/8.x AMQP library

[![Build Status](https://camo.githubusercontent.com/9982b2a3d56602fd8e71f6a07e7751710854912663e78499604e6efb13755876/68747470733a2f2f7472617669732d63692e6f72672f70726f6c69632f48756d7573416d71702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/prolic/HumusAmqp)[![Coverage Status](https://camo.githubusercontent.com/420a7002f7b82b65d28a4475a4137e13b8ea7e5818312150d3a68773fc679041/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f70726f6c69632f48756d7573416d71702f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/prolic/HumusAmqp?branch=master)[![Gitter](https://camo.githubusercontent.com/4bd068f98d960df65b14b4ba28b3dc7a0bf3d972be01804ffbd54c70629ce0de/68747470733a2f2f6261646765732e6769747465722e696d2f70726f6c69632f48756d7573416d71702e737667)](https://gitter.im/prolic/HumusAmqp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)[![Documentation Status](https://camo.githubusercontent.com/1eb55d8f9c2cdc1c61f6038696262b0c3439de0639c12ac00d06a61bd5c23e89/68747470733a2f2f72656164746865646f63732e6f72672f70726f6a656374732f68756d7573616d71702f62616467652f3f76657273696f6e3d6c6174657374)](https://readthedocs.org/projects/humusamqp/badge/?version=latest)

[Documentation](https://humusamqp.readthedocs.io/) powered by Read the Docs.
----------------------------------------------------------------------------

[](#documentation-powered-by-read-the-docs)

Overview
--------

[](#overview)

PHP 7.4 AMQP libray supporting multiple drivers and providing full-featured Consumer, Producer, and JSON-RPC Client / Server implementations.

The JSON-RPC part implements [JSON-RPC 2.0 Specification](http://www.jsonrpc.org/specification).

Current supported drivers are: [php-amqp](https://github.com/pdezwart/php-amqp) and [PhpAmqpLib](https://github.com/php-amqplib/php-amqplib).

php-amqp needs at least to be v1.9.3 php-amqplib needs at least to be v2.11.0

This library ships with `psr/container` factories that help you setting up everything.

Zend Framework and Symfony Framework Integration
------------------------------------------------

[](#zend-framework-and-symfony-framework-integration)

- [ZF Module](https://github.com/prolic/HumusAmqpModule)
- [Symfony Bundle](https://github.com/genhoi/HumusAmqpBundle)

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

[](#installation)

You can install prolic/humus-amqp via composer by adding `"prolic/humus-amqp": "^2.0"` as requirement to your composer.json.

Usage
-----

[](#usage)

### Exchange

[](#exchange)

```
$exchangeName = 'test-exchange';
$exchange = ExchangeFactory::$exchangeName($container);

$exchange->publish('test-message');

```

### Queue

[](#queue)

```
$queueName = 'test-queue';
$queue = QueueFactory::$queueName($container);

$message = $queue->get();
$queue->ack($message->getDeliveryTag());

```

### Producer

[](#producer)

```
$producerName = 'test-producer';
$producer = ProducerFactory::$producerName($container);

$producer->confirmSelect();
$producer->publish(['foo' => 'bar'], 'my-routing-key');
$producer->waitForConfirm();

```

### JSON RPC Client

[](#json-rpc-client)

```
$clientName = 'my-client';
$client = JsonRpcClientFactory::$clientName($container);
$client->addRequest(new JsonRpcRequest('my-server', 'method', ['my' => 'params'], 'id-1'));
$client->addRequest(new JsonRpcRequest('my-server', 'method', ['my' => 'other_params'], 'id-2'));
$responseCollection = $client->getResponseCollection();

```

### JSON RPC Server

[](#json-rpc-server)

```
$serverName = 'my-server';
$server = JsonRpcServerFactory::$serverName($container);
$server->consume();

```

Notes
-----

[](#notes)

### Upgrade from 1.x to 1.4

[](#upgrade-from-1x-to-14)

Before: If `auto_setup_fabric` was enabled, the queue and exchange binding was done automatically. The exchanges would also get created. Anonymous queues required to have `auto_setup_fabric` set to true.

New: If `auto_setup_fabric` is enabled or the queue is anonymous (has no name), the queue gets created and binding is done, but no exchanges are created. If you want to enable creating of depending exchanges (including exchange binding), set the new argument `auto_setup_exchanges` to true.

This is a slight BC break, but the old behaviour was so problematic, that I had to make this change either way.

### AMQP-Extension

[](#amqp-extension)

1. We recommend using php-amqp &gt;=v1.9.3 or compiling it from master, if you encounter any problems with the amqp extension, check their issue tracker, first.

The ext-amqp driver is the most performant.

### PhpAmqpLib

[](#phpamqplib)

1. When using php-amqplib as driver, it's worth point out, that a StreamConnection (same goes for SSLConnection) does not have the possibility to timeout. If you want to let the consumer timeout, when no more messages are received, you should use the SocketConnection instead (assuming you don't need an SSL connection).
2. When using php-amqplib as driver and you're using the LazyConnection, you should not create the channel yourself, call instead `$channel = $connection->newChannel()`

Support
-------

[](#support)

- File issues at .
- Say hello in the [HumusAmqp gitter](https://gitter.im/prolic/HumusAmqp) chat.

Contribute
----------

[](#contribute)

Please feel free to fork and extend existing or add new plugins and send a pull request with your changes! To establish a consistent code quality, please provide unit tests for all your changes and may adapt the documentation.

License
-------

[](#license)

Released under the [MIT](LICENSE.txt).

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 88.6% 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 ~167 days

Recently: every ~362 days

Total

15

Last Release

1330d ago

Major Versions

v1.5.0 → v2.0.02020-03-28

v1.5.1 → v2.1.12022-11-11

PHP version history (5 changes)v1.0.0-BETA.1PHP ~7.0

v1.5.0PHP ^7.2

v2.0.0PHP ^7.4

v1.5.1PHP ^7.1

v2.1.1PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/529819?v=4)[func0der](/maintainers/func0der)[@func0der](https://github.com/func0der)

---

Top Contributors

[![prolic](https://avatars.githubusercontent.com/u/394428?v=4)](https://github.com/prolic "prolic (449 commits)")[![rppgorecki](https://avatars.githubusercontent.com/u/14906108?v=4)](https://github.com/rppgorecki "rppgorecki (18 commits)")[![genhoi](https://avatars.githubusercontent.com/u/8273730?v=4)](https://github.com/genhoi "genhoi (15 commits)")[![basz](https://avatars.githubusercontent.com/u/143068?v=4)](https://github.com/basz "basz (13 commits)")[![oqq](https://avatars.githubusercontent.com/u/7161145?v=4)](https://github.com/oqq "oqq (4 commits)")[![func0der](https://avatars.githubusercontent.com/u/529819?v=4)](https://github.com/func0der "func0der (2 commits)")[![yethee](https://avatars.githubusercontent.com/u/559488?v=4)](https://github.com/yethee "yethee (2 commits)")[![marinovdf](https://avatars.githubusercontent.com/u/2156373?v=4)](https://github.com/marinovdf "marinovdf (1 commits)")[![cwoskoski](https://avatars.githubusercontent.com/u/7571576?v=4)](https://github.com/cwoskoski "cwoskoski (1 commits)")[![samnela](https://avatars.githubusercontent.com/u/1852108?v=4)](https://github.com/samnela "samnela (1 commits)")[![thomasvargiu](https://avatars.githubusercontent.com/u/732012?v=4)](https://github.com/thomasvargiu "thomasvargiu (1 commits)")

---

Tags

queuerabbitmqmessagingAMQPrabbithumus

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/func0der-humus-amqp/health.svg)

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

###  Alternatives

[prolic/humus-amqp

PHP-AMQP library with RabbitMQ Extensions

76210.8k5](/packages/prolic-humus-amqp)[bunny/bunny

Performant pure-PHP AMQP (RabbitMQ) non-blocking ReactPHP library

7526.8M45](/packages/bunny-bunny)[enqueue/enqueue

Message Queue Library

19820.7M63](/packages/enqueue-enqueue)[enqueue/enqueue-bundle

Message Queue Bundle

27716.0M43](/packages/enqueue-enqueue-bundle)[kdyby/rabbitmq

Integrates php-amqplib with RabbitMq and Nette Framework

30721.3k4](/packages/kdyby-rabbitmq)[nuwber/rabbitevents

The Nuwber RabbitEvents package

122529.7k4](/packages/nuwber-rabbitevents)

PHPackages © 2026

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