@@ -711,51 +711,15 @@ states to prevent information and/or memory leakage.
711711
712712However, certain Symfony services, such as the Monolog
713713:ref: `fingers crossed handler <logging-handler-fingers_crossed >`, leak by design.
714- In those cases, use the ``reset_on_message `` transport option to automatically
715- reset the service container between two messages:
714+ That's why Symfony automatically resets the service container between two messages.
715+ If you don't want to reset the container, add the ``--no-reset `` option when
716+ running the ``messenger:consume `` command.
716717
717- .. configuration-block ::
718-
719- .. code-block :: yaml
720-
721- # config/packages/messenger.yaml
722- framework :
723- messenger :
724- reset_on_message : true
725- transports :
726- async :
727- dsn : ' %env(MESSENGER_TRANSPORT_DSN)%'
718+ .. deprecated :: 6.1
728719
729- .. code-block :: xml
730-
731- <!-- config/packages/messenger.xml -->
732- <?xml version =" 1.0" encoding =" UTF-8" ?>
733- <container xmlns =" http://symfony.com/schema/dic/services"
734- xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
735- xmlns : framework =" http://symfony.com/schema/dic/symfony"
736- xsi : schemaLocation =" http://symfony.com/schema/dic/services
737- https://symfony.com/schema/dic/services/services-1.0.xsd
738- http://symfony.com/schema/dic/symfony
739- https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
740-
741- <framework : config >
742- <framework : messenger >
743- <framework : transport name =" async" dsn =" %env(MESSENGER_TRANSPORT_DSN)%" reset-on-message =" true" >
744- </framework : transport >
745- </framework : messenger >
746- </framework : config >
747- </container >
748-
749- .. code-block :: php
750-
751- // config/packages/messenger.php
752- use Symfony\Config\FrameworkConfig;
753-
754- return static function (FrameworkConfig $framework) {
755- $messenger = $framework->messenger();
756-
757- $messenger->resetOnMessage(true);
758- };
720+ In Symfony versions previous to 6.1, the service container didn't reset
721+ automatically between messages and you had to set the
722+ ``framework.messenger.reset_on_message `` option to ``true ``.
759723
760724.. _messenger-retries-failures :
761725
0 commit comments