PHPackages                             stables-q/messenger-enqueue-transport - 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. stables-q/messenger-enqueue-transport

ActiveSymfony-bundle

stables-q/messenger-enqueue-transport
=====================================

Enqueue adapter for Symfony Messenger component

0.5.1(6y ago)0710MITPHP

Since May 8Pushed 6y agoCompare

[ Source](https://github.com/stables-q/messenger-enqueue-transport)[ Packagist](https://packagist.org/packages/stables-q/messenger-enqueue-transport)[ Docs](http://symfony.com)[ RSS](/packages/stables-q-messenger-enqueue-transport/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (13)Used By (0)

Enqueue's transport for Symfony Messenger component
===================================================

[](#enqueues-transport-for-symfony-messenger-component)

This Symfony Messenger transport allows you to use Enqueue to send and receive your messages from all the supported brokers.

Usage
-----

[](#usage)

1. Install the transport

```
composer req sroze/messenger-enqueue-transport

```

2. Configure the Enqueue bundle as you would normaly do ([see Enqueue's Bundle documentation](https://github.com/php-enqueue/enqueue-dev/blob/master/docs/bundle/quick_tour.md)). If you are using the recipes, you should just have to configure the environment variables to configure the `default` Enqueue transport:

```
# .env
# ...

###> enqueue/enqueue-bundle ###
ENQUEUE_DSN=amqp://guest:guest@localhost:5672/%2f
###< enqueue/enqueue-bundle ###
```

3. Configure Messenger's transport (that we will name `amqp`) to use Enqueue's `default` transport:

```
# config/packages/messenger.yaml
framework:
    messenger:
        transports:
            amqp: enqueue://default
```

4. Route the messages that have to go through the message queue:

```
# config/packages/framework.yaml
framework:
    messenger:
        # ...

        routing:
            'App\Message\MyMessage': amqp
```

5. Consume!

```
bin/console messenger:consume amqp
```

Advanced usage
--------------

[](#advanced-usage)

### Configure the queue(s) and exchange(s)

[](#configure-the-queues-and-exchanges)

In the transport DSN, you can add extra configuration. Here is the common reference DSN (note that the values are just for the example):

```
enqueue://default
    ?queue[name]=queue_name
    &topic[name]=topic_name
    &deliveryDelay=1800
    &delayStrategy=Enqueue\AmqpTools\RabbitMqDelayPluginDelayStrategy
    &timeToLive=3600
    &receiveTimeout=1000
    &priority=1

```

### Setting Custom Configuration on your Message

[](#setting-custom-configuration-on-your-message)

Each Enqueue transport (e.g. amqp, redis, etc) has its own message object that can normally be configured by calling setter methods (e.g. `$message->setDeliveryDelay(5000)`). But in Messenger, you don't have access to these objects directly. Instead, you can set them indirectly via the `TransportConfiguration` stamp:

```
use Symfony\Component\Messenger\Envelope;
use Enqueue\MessengerAdapter\EnvelopeItem\TransportConfiguration;

// ...

// create your message like normal
$message = // ...

$transportConfig = (new TransportConfiguration())
    // commmon options have a convenient method
    ->setDeliveryDelay(5000)

    // other transport-specific options are set via metadata
    // example custom option for AmqpMessage
    // each "metadata" will map to a setter on your message
    // will result in setDeliveryMode(AmqpMessage::DELIVERY_MODE_PERSISTENT)
    // being called
    ->addMetadata('deliveryMode', AmqpMessage::DELIVERY_MODE_PERSISTENT)
;

$bus->dispatch((new Envelope($message))->with($transportConfig));
```

### Send a message on a specific topic

[](#send-a-message-on-a-specific-topic)

You can send a message on a specific topic using `TransportConfiguration` envelope item with your message:

```
use Symfony\Component\Messenger\Envelope;
use Enqueue\MessengerAdapter\EnvelopeItem\TransportConfiguration;

// ...

$transportConfig = (new TransportConfiguration())
    ->setTopic('specific-topic')
;

$bus->dispatch((new Envelope($message))->with($transportConfig));
```

### Use AMQP topic exchange

[](#use-amqp-topic-exchange)

See

You can use specific topic and queue options to configure your AMQP exchange in `topic` mode and bind it:

```
enqueue://default
    ?queue[name]=queue_name
    &queue[bindingKey]=foo.#
    &topic[name]=topic_name
    &topic[type]=topic
    &deliveryDelay=1800
    &delayStrategy=Enqueue\AmqpTools\RabbitMqDelayPluginDelayStrategy
    &timeToLive=3600
    &receiveTimeout=1000
    &priority=1

```

Here is the way to send a message with a routing key matching this consumer:

```
$bus->dispatch((new Envelope($message))->with(new TransportConfiguration([
    'topic' => 'topic_name',
    'metadata' => [
        'routingKey' => 'foo.bar'
    ]
])));
```

### Configure custom Kafka message

[](#configure-custom-kafka-message)

Here is the way to send a message with with some custom options:

```
$this->bus->dispatch((new Envelope($message))->with(new TransportConfiguration([
    'topic' => 'test_topic_name',
    'metadata' => [
        'key' => 'foo.bar',
        'partition' => 0,
        'timestamp' => (new \DateTimeImmutable())->getTimestamp(),
        'messageId' => uniqid('kafka_', true),
    ]
])))
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

12

Last Release

2253d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5f4cb79466d68ff2fa0dfb6fb463b0639e95fc11ccf006f7aaba998484a79f81?d=identicon)[stables-q](/maintainers/stables-q)

---

Top Contributors

[![sroze](https://avatars.githubusercontent.com/u/804625?v=4)](https://github.com/sroze "sroze (33 commits)")[![makasim](https://avatars.githubusercontent.com/u/143206?v=4)](https://github.com/makasim "makasim (7 commits)")[![drgomesp](https://avatars.githubusercontent.com/u/696982?v=4)](https://github.com/drgomesp "drgomesp (4 commits)")[![soyuka](https://avatars.githubusercontent.com/u/1321971?v=4)](https://github.com/soyuka "soyuka (4 commits)")[![ogizanagi](https://avatars.githubusercontent.com/u/2211145?v=4)](https://github.com/ogizanagi "ogizanagi (4 commits)")[![KonstantinCodes](https://avatars.githubusercontent.com/u/844484?v=4)](https://github.com/KonstantinCodes "KonstantinCodes (3 commits)")[![weaverryan](https://avatars.githubusercontent.com/u/121003?v=4)](https://github.com/weaverryan "weaverryan (3 commits)")[![Gnucki](https://avatars.githubusercontent.com/u/1064697?v=4)](https://github.com/Gnucki "Gnucki (3 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (2 commits)")[![shulard](https://avatars.githubusercontent.com/u/482993?v=4)](https://github.com/shulard "shulard (2 commits)")[![devrck](https://avatars.githubusercontent.com/u/16414298?v=4)](https://github.com/devrck "devrck (2 commits)")[![xavismeh](https://avatars.githubusercontent.com/u/181753?v=4)](https://github.com/xavismeh "xavismeh (1 commits)")[![Britaliope](https://avatars.githubusercontent.com/u/6175852?v=4)](https://github.com/Britaliope "Britaliope (1 commits)")[![dominikhajduk](https://avatars.githubusercontent.com/u/11769575?v=4)](https://github.com/dominikhajduk "dominikhajduk (1 commits)")[![ekkinox](https://avatars.githubusercontent.com/u/6922385?v=4)](https://github.com/ekkinox "ekkinox (1 commits)")[![keulinho](https://avatars.githubusercontent.com/u/15930605?v=4)](https://github.com/keulinho "keulinho (1 commits)")[![lukascellar](https://avatars.githubusercontent.com/u/4516374?v=4)](https://github.com/lukascellar "lukascellar (1 commits)")[![samnela](https://avatars.githubusercontent.com/u/1852108?v=4)](https://github.com/samnela "samnela (1 commits)")[![scarbo87](https://avatars.githubusercontent.com/u/2161963?v=4)](https://github.com/scarbo87 "scarbo87 (1 commits)")[![stables-q](https://avatars.githubusercontent.com/u/61979441?v=4)](https://github.com/stables-q "stables-q (1 commits)")

---

Tags

symfonyMessengerenqueue

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/stables-q-messenger-enqueue-transport/health.svg)

```
[![Health](https://phpackages.com/badges/stables-q-messenger-enqueue-transport/health.svg)](https://phpackages.com/packages/stables-q-messenger-enqueue-transport)
```

###  Alternatives

[sroze/messenger-enqueue-transport

Enqueue adapter for Symfony Messenger component

1998.7M3](/packages/sroze-messenger-enqueue-transport)[jwage/phpamqplib-messenger

Symfony messenger transport for the php-amqplib/php-amqplib library.

84149.7k1](/packages/jwage-phpamqplib-messenger)[petitpress/gps-messenger-bundle

Google Pub/Sub transport for Symfony Messenger

29491.0k3](/packages/petitpress-gps-messenger-bundle)

PHPackages © 2026

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