PHPackages                             thomasdcodes/pdo-messenger-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. thomasdcodes/pdo-messenger-transport

ActiveSymfony-bundle

thomasdcodes/pdo-messenger-transport
====================================

Gives the possibility to use the symfony messenger transport with a pdo connected database.

0.1.9(1mo ago)010MITPHPPHP &gt;=8.2

Since Mar 11Pushed 1mo agoCompare

[ Source](https://github.com/thomasdcodes/pdo-messenger-transport)[ Packagist](https://packagist.org/packages/thomasdcodes/pdo-messenger-transport)[ RSS](/packages/thomasdcodes-pdo-messenger-transport/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (11)Used By (0)

PdoMessengerTransport
=====================

[](#pdomessengertransport)

General
-------

[](#general)

This Symfony bundle provides a PDO-based transport for the Symfony Messenger component. It serves as a lightweight alternative to the official Doctrine transport, specifically designed for projects that do not use Doctrine ORM or DBAL but still require a reliable database-backed message queue.

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

[](#installation)

### 1. Register the bundle

[](#1-register-the-bundle)

Add the bundle to your `config/bundles.php`:

```
return [
    // ...
    Tdc\PdoMessengerTransport\TdcPdoMessengerTransport::class => ['all' => true],
];
```

### 2. Prepare the database

[](#2-prepare-the-database)

Execute the following Query to create the database table:

```
CREATE TABLE messenger_messages (
    id BIGINT AUTO_INCREMENT PRIMARY KEY,
    body LONGTEXT NOT NULL,
    headers LONGTEXT NOT NULL,
    queue_name VARCHAR(190) NOT NULL,
    available_at DATETIME NOT NULL,
    delivered_at DATETIME DEFAULT NULL,
    created_at DATETIME NOT NULL
);
```

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

[](#configuration)

### 1. Register the PDO Service

[](#1-register-the-pdo-service)

The bundle requires a `\PDO` instance to be registered in your service container. You can define a new PDO service or use an existing one (e.g., from Doctrine):

```
# config/services.yaml
services:
    # Option A: Create a new PDO service
    PDO:
        class: PDO
        arguments:
            - "mysql:host=%env(DB_HOST)%;dbname=%env(DB_NAME)%"
            - "%env(DB_USER)%"
            - "%env(DB_PASSWORD)%"

    # Option B: Use Doctrine's connection
    # PDO:
    #     class: PDO
    #     factory: ['@database_connection', 'getNativeConnection']
```

### 2. Global Bundle Configuration (Mandatory if you don't use autowiring for PDO)

[](#2-global-bundle-configuration-mandatory-if-you-dont-use-autowiring-for-pdo)

Create `config/packages/tdc_pdo_messenger_transport.yaml`:

```
tdc_pdo_messenger_transport:
    pdo_service: 'PDO' # The ID of your PDO service (from step 1)
    table_name: 'messenger_messages' # optional, default: messenger_messages
```

If you don't provide a `pdo_service`, the bundle will try to autowire a `\PDO` instance.

### 3. Configure Symfony Messenger

[](#3-configure-symfony-messenger)

In your messenger configuration, use the `pdoqueue://` DSN.

```
# config/packages/messenger.yaml
framework:
    messenger:
        transports:
            async: 'pdoqueue://default'
```

### Usage

[](#usage)

Run the messenger worker as usual:

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

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance95

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

Every ~0 days

Total

10

Last Release

57d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/50184aa55e9690a3500141891d8898db05b581614b44349c17ccad5593cea3c2?d=identicon)[thomasdcodes](/maintainers/thomasdcodes)

---

Top Contributors

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

---

Tags

symfonytransportMessengersymfony-messenger-transportpdo transport

### Embed Badge

![Health badge](/badges/thomasdcodes-pdo-messenger-transport/health.svg)

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

###  Alternatives

[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M151](/packages/sulu-sulu)[koco/messenger-kafka

Symfony Messenger Kafka Transport

931.1M1](/packages/koco-messenger-kafka)[jwage/phpamqplib-messenger

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

84149.7k1](/packages/jwage-phpamqplib-messenger)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1022.4k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

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