Skip to content

Commit 55edd48

Browse files
t-richardwouterj
authored andcommitted
[Messenger] Add options for PostgreSQL LISTEN/NOTIFY support
1 parent 1a3d0d3 commit 55edd48

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy