Description
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.