PHPackages                             emag-tech-labs/messenger-mongo-bundle - 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. emag-tech-labs/messenger-mongo-bundle

ActiveSymfony-bundle[Queues &amp; Workers](/categories/queues)

emag-tech-labs/messenger-mongo-bundle
=====================================

A Mongo transport for the Symfony Messenger component

1.4.0(5mo ago)16223.0k—0.7%13[1 issues](https://github.com/eMAGTechLabs/messenger-mongo-bundle/issues)MITPHPPHP ^8.1CI failing

Since May 5Pushed 5mo ago6 watchersCompare

[ Source](https://github.com/eMAGTechLabs/messenger-mongo-bundle)[ Packagist](https://packagist.org/packages/emag-tech-labs/messenger-mongo-bundle)[ RSS](/packages/emag-tech-labs-messenger-mongo-bundle/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (9)Versions (14)Used By (0)

Messenger Mongo Bundle
======================

[](#messenger-mongo-bundle)

[![Packagist Version](https://camo.githubusercontent.com/1917cfc13c6f46f49f445a15ad9e4ab32d6c9bbe0edd04da2f6f9f40ea8b9bc7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656d61672d746563682d6c6162732f6d657373656e6765722d6d6f6e676f2d62756e646c65)](https://packagist.org/packages/emag-tech-labs/messenger-mongo-bundle)[![GA build](https://github.com/eMAGTechLabs/messenger-mongo-bundle/workflows/CI/badge.svg?branch=master)](https://github.com/eMAGTechLabs/messenger-mongo-bundle/actions?query=workflow%3ACI)[![codecov](https://camo.githubusercontent.com/ea6b1c3de40238d7df5d4c39222707107dd106e1f72c00a7d38e26efb3d9cf16/68747470733a2f2f636f6465636f762e696f2f67682f654d4147546563684c6162732f6d657373656e6765722d6d6f6e676f2d62756e646c652f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/eMAGTechLabs/messenger-mongo-bundle)[![Mutation testing badge](https://camo.githubusercontent.com/56279321d383c6746d18ae4e1a7630dc69759b99f829f639192bb47e81c55d23/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d253246654d4147546563684c6162732532466d657373656e6765722d6d6f6e676f2d62756e646c652532466d6173746572)](https://dashboard.stryker-mutator.io/reports/github.com/eMAGTechLabs/messenger-mongo-bundle/master)
This bundle offers a new type of transport for the Symfony Messenger component. While MongoDB is not the best tool to be used as a queue, sometimes it's more convenient to use the tools that your application already uses. For example, if your application already uses MongoDB and you want a persistent storage for the failed messages, I think it's quite handy to use MongoDB as a storage.

### Installation

[](#installation)

The recommended way to install the bundle is through Composer:

```
$ composer require emag-tech-labs/messenger-mongo-bundle

```

### Configuration &amp; usage

[](#configuration--usage)

Take a look [here](https://docs.mongodb.com/php-library/current/reference/method/MongoDBClient__construct/) if you need to find out how to configure the **driverOptions**, **uriOptions** and **dsn** options.

```
framework:
    messenger:
        transports:
            hello_queue:
                dsn: mongodb://127.0.0.1:27017
                options:
                    uriOptions: []
                    driverOptions: []
                    database: symfony # required
                    collection: hello_messages # default is "messenger_queue"
                    queue: hello_queue # default is "default"
                    redeliver_timeout: 4800 # default is 3600
                    enable_writeConcern_majority: false # default is true
```

The features described [here](https://symfony.com/doc/current/messenger.html#saving-retrying-failed-messages) can be used also, therefore the following commands are available in order to manually debug the failed messages:

```
# see all messages in the failure transport
$ php bin/console messenger:failed:show

# see details about a specific failed message
$ php bin/console messenger:failed:show 20 -vv

# view and retry messages one-by-one
$ php bin/console messenger:failed:retry -vv

# retry specific messages
$ php bin/console messenger:failed:retry 20 30 --force

# remove a message without retrying it
$ php bin/console messenger:failed:remove

# displays the number of queued messages in all transports
$ php bin/console messenger:stats
```

#### Defining an index for the messages collection

[](#defining-an-index-for-the-messages-collection)

The MongoDB collections where messages are stored (default `messenger_queue`) should have the following index defined:

```
{ available_at: 1 }
```

Without the index, the performance may degrade significantly with a large number of items (100k+) in the queue.

### Submitting bugs and feature requests

[](#submitting-bugs-and-feature-requests)

If you found a nasty bug or want to propose a new feature, you're welcome to open an issue or create a pull request [here](https://github.com/eMAGTechLabs/messenger-mongo-bundle/issues).

###  Health Score

56

—

FairBetter than 97% of packages

Maintenance69

Regular maintenance activity

Popularity45

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 60% 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 ~231 days

Recently: every ~318 days

Total

10

Last Release

171d ago

Major Versions

0.1.1 → 1.0.02021-07-06

PHP version history (5 changes)0.1.0PHP ^7.3

0.1.1PHP ^7.2

1.0.0PHP ^7.4|^8.0

1.1.0PHP ^7.4 || ^8.0

1.2.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/781716?v=4)[Iosif Chiriluta](/maintainers/iosifch)[@iosifch](https://github.com/iosifch)

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

---

Top Contributors

[![iosifch](https://avatars.githubusercontent.com/u/781716?v=4)](https://github.com/iosifch "iosifch (33 commits)")[![mihaileu](https://avatars.githubusercontent.com/u/54336101?v=4)](https://github.com/mihaileu "mihaileu (14 commits)")[![hakanbolat](https://avatars.githubusercontent.com/u/8198353?v=4)](https://github.com/hakanbolat "hakanbolat (1 commits)")[![markitosgv](https://avatars.githubusercontent.com/u/1706470?v=4)](https://github.com/markitosgv "markitosgv (1 commits)")[![mateicarpen](https://avatars.githubusercontent.com/u/9387807?v=4)](https://github.com/mateicarpen "mateicarpen (1 commits)")[![melkamar](https://avatars.githubusercontent.com/u/3999871?v=4)](https://github.com/melkamar "melkamar (1 commits)")[![mustanggb](https://avatars.githubusercontent.com/u/1636013?v=4)](https://github.com/mustanggb "mustanggb (1 commits)")[![adrianmihaila](https://avatars.githubusercontent.com/u/15153934?v=4)](https://github.com/adrianmihaila "adrianmihaila (1 commits)")[![winiarekk](https://avatars.githubusercontent.com/u/7046294?v=4)](https://github.com/winiarekk "winiarekk (1 commits)")[![beniamin](https://avatars.githubusercontent.com/u/811812?v=4)](https://github.com/beniamin "beniamin (1 commits)")

---

Tags

messenger-mongo-bundlemongodbqueuesymfonysymfony-messengertransport

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/emag-tech-labs-messenger-mongo-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/emag-tech-labs-messenger-mongo-bundle/health.svg)](https://phpackages.com/packages/emag-tech-labs-messenger-mongo-bundle)
```

###  Alternatives

[symfony/doctrine-messenger

Symfony Doctrine Messenger Bridge

53295.8M257](/packages/symfony-doctrine-messenger)[symfony/redis-messenger

Symfony Redis extension Messenger Bridge

21748.9M58](/packages/symfony-redis-messenger)[symfony/amqp-messenger

Symfony AMQP extension Messenger Bridge

29459.2M109](/packages/symfony-amqp-messenger)[symfony/amazon-sqs-messenger

Symfony Amazon SQS extension Messenger Bridge

4614.0M22](/packages/symfony-amazon-sqs-messenger)[shopware/storefront

Storefront for Shopware

684.6M236](/packages/shopware-storefront)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)

PHPackages © 2026

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