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

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

amqp-reply/amqp-reply
=====================

A variation of 'amqp-messenger' that allows to send a message and wait for a reply

1.0.0(1y ago)3103MITPHPPHP &gt;=8.1CI passing

Since Mar 17Pushed 1y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

AMQP Reply Bundle
=================

[](#amqp-reply-bundle)

[![codecov](https://camo.githubusercontent.com/79cd3767f0288f5c60f5698a5551ec17f808145e52a1c826e7a5b29cd6482566/68747470733a2f2f636f6465636f762e696f2f67682f636f6e656a65726f636b2f616d70712d62756e646c652f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d4e5a3135433759513158)](https://codecov.io/gh/conejerock/ampq-bundle)

AMQP Reply Bundle is an extension of Symfony's `amqp-messenger` that abstracts RabbitMQ's RPC (Remote Procedure Call) functionality. It provides a simple and flexible way to send messages and wait for a response in Symfony microservices architecture.

Why Use AMQP Reply Bundle?
--------------------------

[](#why-use-amqp-reply-bundle)

- **Simple RPC Handling:** No need to manually implement RabbitMQ RPC.
- **Seamless Symfony Integration:** Works directly with Symfony Messenger.
- **Improved Microservices Communication:** Enables synchronous message processing while maintaining decoupled services.
- **Reliable Response Management:** Built-in support for handling responses efficiently.

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

[](#installation)

```
composer require amqp-reply/amqp-reply
```

Configuration
-------------

[](#configuration)

Ensure your Symfony Messenger transport configuration supports AMQP:

```
framework:
  messenger:
    transports:
      my_transport_sync:
        dsn: 'amqp://guest:guest@rabbitmq:5672'
        options:
          exchange:
            name: query_exchange
            type: topic
          queues:
            query_queue: ~
          reply: # Option to enable amqp-reply
            timeout: 5
            prefix: 'my_reply_'
    routing:
      'App\Query\MyQuery': my_transport_sync
```

Usage
-----

[](#usage)

### Sending a Request and Waiting for a Reply

[](#sending-a-request-and-waiting-for-a-reply)

```
declare(strict_types=1);

namespace App;

use Symfony\Component\Messenger\MessageBusInterface;
use App\Query\MyQuery;
use App\Query\MyQueryResponse;

final class RpcClient
{
    public function __construct(private MessageBusInterface $bus) {}

    public function __invoke(): string
    {
        $handledStamp = $this->bus->dispatch(new MyQuery($id))->last(HandledStamp::class)
        /** @var MyQueryResponse $response */
        $response = $handledStamp->getResult();
        return $response->message;
    }
}
```

### Handling the Request in a Consumer

[](#handling-the-request-in-a-consumer)

```
declare(strict_types=1);

namespace App\Query;

use Symfony\Component\Messenger\Attribute\AsMessageHandler;

final class MyQuery
{
    public function __construct(public readonly string $id) {}
}

final class MyQueryResponse
{
    public function __construct(public readonly string $message) {}
}

#[AsMessageHandler]
class MyQueryHandler
{

    public function __invoke(MyQuery $query): MyQueryResponse
    {
        $message = 'Hello, ' . $query->id;
        return new MyQueryResponse($message);
    }
}
```

### Consuming requests

[](#consuming-requests)

```
php bin/console messenger:consume my_transport_sync
```

License
-------

[](#license)

This library is licensed under the [MIT License](LICENSE).

Author
------

[](#author)

Developed by [Juanjo Conejero](https://juanjoconejero.com).

Contribute
----------

[](#contribute)

Contributions are welcome! Feel free to open issues and pull requests to improve this library.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance48

Moderate activity, may be stable

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

Unknown

Total

1

Last Release

417d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/891f311078a46a67e226fa137f6747d7686fa77ebb0e378ac99e42d643a1673e?d=identicon)[conejerock](/maintainers/conejerock)

---

Top Contributors

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

---

Tags

microservicesqueuerabbitmqrpcsymfonyresponserpcrabbitmqAMQPMessengermicroservicesreply

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[php-amqplib/rabbitmq-bundle

Integrates php-amqplib with Symfony &amp; RabbitMq. Formerly emag-tech-labs/rabbitmq-bundle, oldsound/rabbitmq-bundle.

1.3k20.1M64](/packages/php-amqplib-rabbitmq-bundle)[bunny/bunny

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

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

Message Queue Bundle

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

Message Queue Library

19820.0M56](/packages/enqueue-enqueue)[nuwber/rabbitevents

The Nuwber RabbitEvents package

120515.8k3](/packages/nuwber-rabbitevents)[bschmitt/laravel-amqp

AMQP wrapper for Laravel and Lumen to publish and consume messages

2752.3M7](/packages/bschmitt-laravel-amqp)

PHPackages © 2026

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