PHPackages                             autoprotect-group/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. [API Development](/categories/api)
4. /
5. autoprotect-group/messenger-enqueue-transport

ActiveSymfony-bundle[API Development](/categories/api)

autoprotect-group/messenger-enqueue-transport
=============================================

Enqueue adapter for Symfony Messenger component

0.7.0(4y ago)02531MITPHP

Since May 8Pushed 4y agoCompare

[ Source](https://github.com/AutoProtect-Group/messenger-enqueue-transport)[ Packagist](https://packagist.org/packages/autoprotect-group/messenger-enqueue-transport)[ Docs](https://github.com/AutoProtect-Group/messenger-enqueue-transport)[ RSS](/packages/autoprotect-group-messenger-enqueue-transport/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (9)Versions (15)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/messenger.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

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor3

3 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 ~110 days

Recently: every ~203 days

Total

14

Last Release

1490d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e68462bd35d4a631e6a898283983361f6087f3f2ce2bd353ebe3c4b41f33861?d=identicon)[gep](/maintainers/gep)

---

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)")[![soyuka](https://avatars.githubusercontent.com/u/1321971?v=4)](https://github.com/soyuka "soyuka (4 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (4 commits)")[![ogizanagi](https://avatars.githubusercontent.com/u/2211145?v=4)](https://github.com/ogizanagi "ogizanagi (4 commits)")[![drgomesp](https://avatars.githubusercontent.com/u/696982?v=4)](https://github.com/drgomesp "drgomesp (4 commits)")[![KonstantinCodes](https://avatars.githubusercontent.com/u/844484?v=4)](https://github.com/KonstantinCodes "KonstantinCodes (3 commits)")[![Gnucki](https://avatars.githubusercontent.com/u/1064697?v=4)](https://github.com/Gnucki "Gnucki (3 commits)")[![weaverryan](https://avatars.githubusercontent.com/u/121003?v=4)](https://github.com/weaverryan "weaverryan (3 commits)")[![devrck](https://avatars.githubusercontent.com/u/16414298?v=4)](https://github.com/devrck "devrck (2 commits)")[![dzianis-hrynko](https://avatars.githubusercontent.com/u/55101692?v=4)](https://github.com/dzianis-hrynko "dzianis-hrynko (2 commits)")[![andrewmy](https://avatars.githubusercontent.com/u/715595?v=4)](https://github.com/andrewmy "andrewmy (2 commits)")[![shulard](https://avatars.githubusercontent.com/u/482993?v=4)](https://github.com/shulard "shulard (2 commits)")[![xavismeh](https://avatars.githubusercontent.com/u/181753?v=4)](https://github.com/xavismeh "xavismeh (1 commits)")[![andreybolonin](https://avatars.githubusercontent.com/u/2576509?v=4)](https://github.com/andreybolonin "andreybolonin (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)")[![fractalzombie](https://avatars.githubusercontent.com/u/5721336?v=4)](https://github.com/fractalzombie "fractalzombie (1 commits)")[![gep](https://avatars.githubusercontent.com/u/223114?v=4)](https://github.com/gep "gep (1 commits)")

---

Tags

symfonyMessengerenqueue

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[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)[gheb/docusign-bundle

Symfony Bundle for electronic document signature with Docusign

3520.8k](/packages/gheb-docusign-bundle)

PHPackages © 2026

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