You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<spanid="docs-mezzio-messenger-config"></span><h1>Configuration<aclass="headerlink" href="#configuration" title="Permalink to this headline"></a></h1>
85
+
<p>The configuration for this bridge is defined under the <codeclass="docutils literal notranslate"><spanclass="pre">messageBus</span></code> namespace for the <codeclass="docutils literal notranslate"><spanclass="pre">Laminas\ConfigAggregator</span></code>.
86
+
It holds multiple path variables, mapping arrays and a failure transport definition.</p>
87
+
<p>Any message that is apssed through a messenger middleware or through a command (working asynchronously) will be logged
88
+
with the <aclass="reference external" href="https://packagist.org/packages/monolog/monolog">Monolog</a> library. Some of the Symfony commands to handle
89
+
the worker need a cache. Both of these paths can be defined with following configuration. The default configuration
90
+
will store files in the <codeclass="docutils literal notranslate"><spanclass="pre">data/cache/message-bus</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">data/logs/message-bus</span></code> directories.</p>
<p>For each configured transport DSN, a service named <codeclass="docutils literal notranslate"><spancl
10000
ass="pre">Transport::$name</span></code> will be added to the service container, holding
118
+
an instance of <codeclass="docutils literal notranslate"><spanclass="pre">Symfony\Component\Messenger\Transport\TransportInterface</span></code> with the necessary connection to the broker.
119
+
To get a transport from the container, you can either pass the string - e.g. <codeclass="docutils literal notranslate"><spanclass="pre">Transport::default</span></code> - or use the helper
120
+
<codeclass="docutils literal notranslate"><spanclass="pre">MessageBus\Factory\Transporthelper::createTransportName($name)</span></code> for the <codeclass="docutils literal notranslate"><spanclass="pre">$container->get(...)</span></code> instruction.</p>
121
+
<p>One of those transports should be defined as the ‘failure transport’. Symfony messenger will put any message that has
122
+
failed 3 times onto this transport. It also offers commands to display and retry failed messages or remove them savely.
123
+
This transport does not have to be named ‘failure’.</p>
<h2>Delegating the messages<aclass="headerlink" href="#delegating-the-messages" title="Permalink to this headline"></a></h2>
134
+
<p>Each message needs a ‘Worker’ to handle it. You can find out more in the “<aclass="reference internal" href="how-to-use.html#docs-mezzio-messenger-how-to"><spanclass="std std-ref">How to use the bridge</span></a>” section
135
+
or in the <aclass="reference external" href="https://symfony.com/doc/current/messenger.html">Symfony documentation</a>. The bridge handles the associations
136
+
via array maps, defining message to worker(s) and message to transport(s). You can pass a string or array as value.</p>
<ahref="how-to-use.html" class="btn btn-neutral float-right" title="How to use the bridge" accesskey="n" rel="next">Next <spanclass="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
161
+
</div>
162
+
163
+
<hr/>
164
+
165
+
<divrole="contentinfo">
166
+
<p>© Copyright 2022, Sengorius.</p>
167
+
</div>
168
+
169
+
Built with <ahref="https://www.sphinx-doc.org/">Sphinx</a> using a
0 commit comments