diff --git a/messenger.rst b/messenger.rst index 35d2f056da6..a292b3a5ac8 100644 --- a/messenger.rst +++ b/messenger.rst @@ -711,51 +711,15 @@ states to prevent information and/or memory leakage. However, certain Symfony services, such as the Monolog :ref:`fingers crossed handler `, leak by design. -In those cases, use the ``reset_on_message`` transport option to automatically -reset the service container between two messages: +That's why Symfony automatically resets the service container between two messages. +If you don't want to reset the container, add the ``--no-reset`` option when +running the ``messenger:consume`` command. -.. configuration-block:: - - .. code-block:: yaml - - # config/packages/messenger.yaml - framework: - messenger: - reset_on_message: true - transports: - async: - dsn: '%env(MESSENGER_TRANSPORT_DSN)%' +.. deprecated:: 6.1 - .. code-block:: xml - - - - - - - - - - - - - - .. code-block:: php - - // config/packages/messenger.php - use Symfony\Config\FrameworkConfig; - - return static function (FrameworkConfig $framework) { - $messenger = $framework->messenger(); - - $messenger->resetOnMessage(true); - }; + In Symfony versions previous to 6.1, the service container didn't reset + automatically between messages and you had to set the + ``framework.messenger.reset_on_message`` option to ``true``. .. _messenger-retries-failures: