Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Messenger] Incompatibility with DBAL >=3.0 on PostgreSQL transport #42589

Closed
@ohaag

Description

@ohaag

Symfony version(s) affected: 5.3.4

Description

When using the messenger component with symfony/doctrine-messenger on PostgreSQL, if you're not using doctrine/orm, you can update doctrine/dbal to >=3.0. However, for >=3.0, when we run a consumer, the PDO\Connection does not have pgsqlGetNotify method anymore. If I specify doctrine/dbal < 3.0 in my composer, it works well in 2.13.

How to reproduce

Create a project and require symfony/messenger and symfony/doctrine-messenger. You should have dependencies like this (and some other symfony packages)

"require": {
        "php": ">=7.2.5",
        "doctrine/doctrine-bundle": "^2.4",
        "symfony/doctrine-messenger": "5.3.*",
        "symfony/framework-bundle": "5.3.*",
        "symfony/messenger": "5.3.*",
}

and your doctrine/dbal should be >3.0

Setup a message handler using Doctrine Transport. Then if you run the consumer, you will have an error reporting that the pgsqlGetNotify method does not exist.

The line triggering the error: https://github.com/symfony/doctrine-messenger/blob/5.3/Transport/PostgreSqlConnection.php#L75

Additional context

On many projects, the bug will not happen because doctrine/orm (2.9.3 at the moment) or doctrine/migrations, both prevent the upgrade to doctrine/dbal >=3.0.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions