You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the DoctrineTransport with PostgreSQL, the queue table is created with a trigger to enable LISTEN/NOTIFY feature.
This is done by checking if the driver is an instance of AbstractPostgreSQLDriver.
… decorated PostgreSQL driver (alamirault)
This PR was squashed before being merged into the 5.4 branch.
Discussion
----------
[Messenger] DoctrineTransportFactory works with notify and decorated PostgreSQL driver
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#45835
| License | MIT
| Doc PR |
This PR allow to use Notify connection with Decorated PostgreSQL driver and not only for `AbstractPostgreSQLDriver`
Commits
-------
07c3125 [Messenger] DoctrineTransportFactory works with notify and decorated PostgreSQL driver
Symfony version(s) affected
5.1.8 and up
Description
When using the DoctrineTransport with PostgreSQL, the queue table is created with a trigger to enable LISTEN/NOTIFY feature.
This is done by checking if the driver is an instance of
AbstractPostgreSQLDriver
.symfony/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/DoctrineTransportFactory.php
Lines 51 to 55 in acf1f71
This check won't work though, if the driver is decorated. This then leads to missing trigger to use the LISTEN/NOTIFY feature.
How to reproduce
I experienced this when when having
sentry/sentry-symfony
installed.My
sentry.yaml
looks like this:Possible Solution
Currently the check is done by checking the instance of the driver in the DoctrineTransportFactory.
symfony/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/DoctrineTransportFactory.php
Line 51 in acf1f71
Instead of checking the Driver itself, we might get the platform and check if the platform is of type
PostgreSQLPlatform
like so:if ($useNotify && $driverConnection->getDriver()->getDatabasePlatform() instanceof PostgreSQLPlatform) {
Is this a viable solution or do I miss something here?
Additional Context
No response
The text was updated successfully, but these errors were encountered: