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

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

prolic/humus-amqp
=================

PHP-AMQP library with RabbitMQ Extensions

v2.2.0(2y ago)76205.4k—8.1%17[5 issues](https://github.com/prolic/HumusAmqp/issues)5MITPHPPHP ^7.4 || ^8.0

Since Jun 7Pushed 2y ago13 watchersCompare

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

READMEChangelog (10)Dependencies (15)Versions (16)Used By (5)

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

[](#humus-amqp)

PHP 7.4 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 v3

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

46

—

FairBetter than 93% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity47

Moderate usage in the ecosystem

Community30

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 81.5% 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 ~190 days

Recently: every ~441 days

Total

15

Last Release

967d ago

Major Versions

v1.5.0 → v2.0.02020-03-28

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

v1.5.0PHP ^7.2

v2.0.0PHP ^7.4

v2.1.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/394428?v=4)[Sascha-Oliver Prolić](/maintainers/prolic)[@prolic](https://github.com/prolic)

---

Top Contributors

[![prolic](https://avatars.githubusercontent.com/u/394428?v=4)](https://github.com/prolic "prolic (449 commits)")[![basz](https://avatars.githubusercontent.com/u/143068?v=4)](https://github.com/basz "basz (58 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)")[![oqq](https://avatars.githubusercontent.com/u/7161145?v=4)](https://github.com/oqq "oqq (4 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)")[![func0der](https://avatars.githubusercontent.com/u/529819?v=4)](https://github.com/func0der "func0der (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

amqpjson-rpcmessagingphpphp-amqpphp-amqplibphp7rabbitmqqueuerabbitmqmessagingAMQPrabbithumus

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[bunny/bunny

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

7426.5M37](/packages/bunny-bunny)[enqueue/enqueue

Message Queue Library

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

Message Queue Bundle

27615.6M38](/packages/enqueue-enqueue-bundle)[kdyby/rabbitmq

Integrates php-amqplib with RabbitMq and Nette Framework

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

The Nuwber RabbitEvents package

120515.8k3](/packages/nuwber-rabbitevents)[prolic/humus-amqp-module

AMQP module for Zend Framework 2 to integrate RabbitMQ

3157.0k1](/packages/prolic-humus-amqp-module)

PHPackages © 2026

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