Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 208f6d9

Browse filesBrowse files
bug #53960 [Messenger] the 'use_notify' option is on the factory, not on the postgres connection (dbu)
This PR was merged into the 5.4 branch. Discussion ---------- [Messenger] the 'use_notify' option is on the factory, not on the postgres connection | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes (documentation bug) | New feature? | no | Deprecations? | yes/no i think not - or do we consider removing the unused `use_notify` from PostgreSqlConnection::DEFAULT_OPTIONS a BC break? then we would have to leave it there but comment that it is unused | Issues | - | License | MIT I was debugging messenger not seeing updates and stumbled over this. I guess things changed before release or had been different in older versions. (side note: listen/notify does not work for me when using the symfony skeleton setup, so i had to disable the mechanism. i assume it is cheaper to try to install the listener on each `get` than querying the messages table? a little bit of documentation as to why the functionality is used would not hurt) Commits ------- 2b82b4a the 'use_notify' option is on the factory, not on the postgres connection class
2 parents 21afb26 + 2b82b4a commit 208f6d9
Copy full SHA for 208f6d9

File tree

2 files changed

+5
-2
lines changed
Filter options

2 files changed

+5
-2
lines changed

‎src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/DoctrineTransportFactory.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/DoctrineTransportFactory.php
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ public function __construct($registry)
3535
$this->registry = $registry;
3636
}
3737

38+
/**
39+
* @param array $options You can set 'use_notify' to false to not use LISTEN/NOTIFY with postgresql
40+
*/
3841
public function createTransport(string $dsn, array $options, SerializerInterface $serializer): TransportInterface
3942
{
4043
$useNotify = ($options['use_notify'] ?? true);

‎src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/PostgreSqlConnection.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/PostgreSqlConnection.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@
1616
/**
1717
* Uses PostgreSQL LISTEN/NOTIFY to push messages to workers.
1818
*
19+
* If you do not want to use the LISTEN mechanism, set the `use_notify` option to `false` when calling DoctrineTransportFactory::createTransport.
20+
*
1921
* @internal
2022
*
2123
* @author Kévin Dunglas <dunglas@gmail.com>
2224
*/
2325
final class PostgreSqlConnection extends Connection
2426
{
2527
/**
26-
* * use_notify: Set to false to disable the use of LISTEN/NOTIFY. Default: true
2728
* * check_delayed_interval: The interval to check for delayed messages, in milliseconds. Set to 0 to disable checks. Default: 60000 (1 minute)
2829
* * get_notify_timeout: The length of time to wait for a response when calling PDO::pgsqlGetNotify, in milliseconds. Default: 0.
2930
*/
3031
protected const DEFAULT_OPTIONS = parent::DEFAULT_OPTIONS + [
31-
'use_notify' => true,
3232
'check_delayed_interval' => 60000,
3333
'get_notify_timeout' => 0,
3434
];

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.