8000 feature #15043 [Messenger] Add options for PostgreSQL LISTEN/NOTIFY s… · symfony/symfony-docs@d74f702 · GitHub
[go: up one dir, main page]

Skip to content

Commit d74f702

Browse files
committed
feature #15043 [Messenger] Add options for PostgreSQL LISTEN/NOTIFY support (t-richard)
This PR was squashed before being merged into the 5.2 branch. Discussion ---------- [Messenger] Add options for PostgreSQL LISTEN/NOTIFY support <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `5.x` for features of unreleased versions). --> Documents symfony/symfony#35485 Closes #13039 Commits ------- 55edd48 [Messenger] Add options for PostgreSQL LISTEN/NOTIFY support
2 parents 1a3d0d3 + 55edd48 commit d74f702

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

messenger.rst

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,12 @@ a table named ``messenger_messages``.
10741074
Or, to create the table yourself, set the ``auto_setup`` option to ``false`` and
10751075
:ref:`generate a migration <doctrine-creating-the-database-tables-schema>`.
10761076

1077+
.. caution::
1078+
1079+
The datetime property of the messages stored in the database uses the
1080+
timezone of the current system. This may cause issues if multiple machines
1081+
with different timezone configuration use the same storage.
1082+
10771083
The transport has a number of options:
10781084

10791085
================== ===================================== ======================
@@ -1093,11 +1099,28 @@ auto_setup Whether the table should be created
10931099
automatically during send / get. true
10941100
================== ===================================== ======================
10951101

1096-
.. caution::
1102+
.. versionadded:: 5.1
10971103

1098-
The datetime property of the messages stored in the database uses the
1099-
timezone of the current system. This may cause issues if multiple machines
1100-
with different timezone configuration use the same storage.
1104+
The ability to leverage PostgreSQL's LISTEN/NOTIFY was introduced
1105+
in Symfony 5.1.
1106+
1107+
When using PostgreSQL, you have access to the following options to leverage
1108+
the `LISTEN/NOTIFY`_ feature. This allow for a more performant approach
1109+
than the default polling behavior of the Doctrine transport because
1110+
PostgreSQL will directly notify the workers when a new message is inserted
1111+
in the table.
1112+
1113+
======================= ===================================== ======================
1114+
Option Description Default
1115+
======================= ===================================== ======================
1116+
use_notify Whether to use LISTEN/NOTIFY. true
1117+
check_delayed_interval The interval to check for delayed 1000
1118+
messages, in milliseconds.
1119+
Set to 0 to disable checks.
1120+
get_notify_timeout The length of time to wait for a 0
1121+
response when calling
1122+
``PDO::pgsqlGetNotify```, in milliseconds.
1123+
======================= ========================================== ======================
11011124

11021125
Beanstalkd Transport
11031126
~~~~~~~~~~~~~~~~~~~~
@@ -1971,3 +1994,4 @@ Learn more
19711994
.. _`Long polling`: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html
19721995
.. _`Visibility Timeout`: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
19731996
.. _`FIFO queue`: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html
1997+
.. _`LISTEN/NOTIFY`: https://www.postgresql.org/docs/current/sql-notify.html

0 commit comments

Comments
 (0)
0