From 2b82b4a9042fc8f6144ca32e822ae2db9eb128db Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Thu, 15 Feb 2024 22:03:16 +0100 Subject: [PATCH] the 'use_notify' option is on the factory, not on the postgres connection class --- .../Bridge/Doctrine/Transport/DoctrineTransportFactory.php | 3 +++ .../Bridge/Doctrine/Transport/PostgreSqlConnection.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/DoctrineTransportFactory.php b/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/DoctrineTransportFactory.php index 4ddb85882970c..4011decd85be2 100644 --- a/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/DoctrineTransportFactory.php +++ b/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/DoctrineTransportFactory.php @@ -35,6 +35,9 @@ public function __construct($registry) $this->registry = $registry; } + /** + * @param array $options You can set 'use_notify' to false to not use LISTEN/NOTIFY with postgresql + */ public function createTransport(string $dsn, array $options, SerializerInterface $serializer): TransportInterface { $useNotify = ($options['use_notify'] ?? true); diff --git a/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/PostgreSqlConnection.php b/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/PostgreSqlConnection.php index 4d0c3f422971d..545856d762339 100644 --- a/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/PostgreSqlConnection.php +++ b/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/PostgreSqlConnection.php @@ -16,6 +16,8 @@ /** * Uses PostgreSQL LISTEN/NOTIFY to push messages to workers. * + * If you do not want to use the LISTEN mechanism, set the `use_notify` option to `false` when calling DoctrineTransportFactory::createTransport. + * * @internal * * @author Kévin Dunglas @@ -23,12 +25,10 @@ final class PostgreSqlConnection extends Connection { /** - * * use_notify: Set to false to disable the use of LISTEN/NOTIFY. Default: true * * check_delayed_interval: The interval to check for delayed messages, in milliseconds. Set to 0 to disable checks. Default: 60000 (1 minute) * * get_notify_timeout: The length of time to wait for a response when calling PDO::pgsqlGetNotify, in milliseconds. Default: 0. */ protected const DEFAULT_OPTIONS = parent::DEFAULT_OPTIONS + [ - 'use_notify' => true, 'check_delayed_interval' => 60000, 'get_notify_timeout' => 0, ];