8000 drafted a new release for the Mezzio-Messenger-Bridge · Sengorius/sengorius.github.io@cc8a8ea · GitHub
[go: up one dir, main page]

Skip to content

Commit cc8a8ea

Browse files
author
Sengorius
committed
drafted a new release for the Mezzio-Messenger-Bridge
1 parent 87c40f3 commit cc8a8ea

File tree

14 files changed

+579
-1
lines changed

14 files changed

+579
-1
lines changed

docs/genindex.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
<ul>
4141
<li class="toctree-l1"><a class="reference internal" href="repositories/docker-proxy/index.html">Docker-Proxy-Stack</a></li>
4242
<li class="toctree-l1"><a class="reference internal" href="repositories/simple-rest/index.html">Simple REST Bundle</a></li>
43+
<li class="toctree-l1"><a class="reference internal" href="repositories/mezzio-messenger/index.html">Mezzio: Symfony-Messenger-Bridge</a></li>
4344
</ul>
4445

4546
</div>

docs/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
<ul>
4343
<li class="toctree-l1"><a class="reference internal" href="repositories/docker-proxy/index.html">Docker-Proxy-Stack</a></li>
4444
<li class="toctree-l1"><a class="reference internal" href="repositories/simple-rest/index.html">Simple REST Bundle</a></li>
45+
<li class="toctree-l1"><a class="reference internal" href="repositories/mezzio-messenger/index.html">Mezzio: Symfony-Messenger-Bridge</a></li>
4546
</ul>
4647

4748
</div>

docs/objects.inv

132 Bytes
Binary file not shown.

docs/repositories/docker-proxy/docker-exec.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
</ul>
6161
</li>
6262
<li class="toctree-l1"><a class="reference internal" href="../simple-rest/index.html">Simple REST Bundle</a></li>
63+
<li class="toctree-l1"><a class="reference internal" href="../mezzio-messenger/index.html">Mezzio: Symfony-Messenger-Bridge</a></li>
6364
</ul>
6465

6566
</div>

docs/repositories/docker-proxy/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
</ul>
5757
</li>
5858
<li class="toctree-l1"><a class="reference internal" href="../simple-rest/index.html">Simple REST Bundle</a></li>
59+
<li class="toctree-l1"><a class="reference internal" href="../mezzio-messenger/index.html">Mezzio: Symfony-Messenger-Bridge</a></li>
5960
</ul>
6061

6162
</div>

docs/repositories/docker-proxy/install.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
</ul>
6464
</li>
6565
<li class="toctree-l1"><a class="reference internal" href="../simple-rest/index.html">Simple REST Bundle</a></li>
66+
<li class="toctree-l1"><a class="reference internal" href="../mezzio-messenger/index.html">Mezzio: Symfony-Messenger-Bridge</a></li>
6667
</ul>
6768

6869
</div>

docs/repositories/docker-proxy/mailcatching.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
</ul>
5858
</li>
5959
<li class="toctree-l1"><a class="reference internal" href="../simple-rest/index.html">Simple REST Bundle</a></li>
60+
<li class="toctree-l1"><a class="reference internal" href="../mezzio-messenger/index.html">Mezzio: Symfony-Messenger-Bridge</a></li>
6061
</ul>
6162

6263
</div>

docs/repositories/docker-proxy/upgrade-v2.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
</ul>
5858
</li>
5959
<li class="toctree-l1"><a class="reference internal" href="../simple-rest/index.html">Simple REST Bundle</a></li>
60+
<li class="toctree-l1"><a class="reference internal" href="../mezzio-messenger/index.html">Mezzio: Symfony-Messenger-Bridge</a></li>
6061
</ul>
6162

6263
</div>
Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
<!DOCTYPE html>
2+
<html class="writer-html5" lang="en" >
3+
<head>
4+
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
5+
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Configuration &mdash; 1.0.0 documentation</title>
8+
<link rel="stylesheet" href="../../static/pygments.css" type="text/css" />
9+
<link rel="stylesheet" href="../../static/css/theme.css" type="text/css" />
10+
<link rel="stylesheet" href="../../static/additional.css" type="text/css" />
11+
<link rel="shortcut icon" href="../../static/favicon.ico"/>
12+
<!--[if lt IE 9]>
13+
<script src="../../static/js/html5shiv.min.js"></script>
14+
<![endif]-->
15+
16+
<script data-url_root="../../" id="documentation_options" src="../../static/documentation_options.js"></script>
17+
<script src="../../static/jquery.js"></script>
18+
<script src="../../static/underscore.js"></script>
19+
<script src="../../static/doctools.js"></script>
20+
<script src="../../static/js/theme.js"></script>
21+
<link rel="index" title="Index" href="../../genindex.html" />
22+
<link rel="search" title="Search" href="../../search.html" />
23+
<link rel="next" title="How to use the bridge" href="how-to-use.html" />
24+
<link rel="prev" title="Mezzio: Symfony-Messenger-Bridge" href="index.html" />
25+
</head>
26+
27+
<body class="wy-body-for-nav">
28+
<div class="wy-grid-for-nav">
29+
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
30+
<div class="wy-side-scroll">
31+
<div class="wy-side-nav-search" >
32+
<a href="../../index.html" class="icon icon-home">
33+
<img src="../../static/cogs_v3_256.png" class="logo" alt="Logo"/>
34+
</a>
35+
<div role="search">
36+
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
37+
<input type="text" name="q" placeholder="Search docs" />
38+
<input type="hidden" name="check_keywords" value="yes" />
39+
<input type="hidden" name="area" value="default" />
40+
</form>
41+
</div>
42+
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
43+
<ul class="current">
44+
<li class="toctree-l1"><a class="reference internal" href="../docker-proxy/index.html">Docker-Proxy-Stack</a></li>
45+
<li class="toctree-l1"><a class="reference internal" href="../simple-rest/index.html">Simple REST Bundle</a></li>
46+
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Mezzio: Symfony-Messenger-Bridge</a><ul class="current">
47+
<li class="toctree-l2"><a class="reference external" href="https://github.com/Sengorius/docker-proxy-stack">GitHub Repository</a></li>
48+
<li class="toctree-l2 current"><a class="current reference internal" href="#">Configuration</a><ul>
49+
<li class="toctree-l3"><a class="reference internal" href="#transports">Transports</a></li>
50+
<li class="toctree-l3"><a class="reference internal" href="#delegating-the-messages">Delegating the messages</a></li>
51+
</ul>
52+
</li>
53+
<li class="toctree-l2"><a class="reference internal" href="how-to-use.html">How to use the bridge</a></li>
54+
<li class="toctree-l2"><a class="reference internal" href="index.html#installation">Installation</a></li>
55+
</ul>
56+
</li>
57+
</ul>
58+
59+
</div>
60+
</div>
61+
</nav>
62+
63+
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
64+
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
65+
<a href="../../index.html"></a>
66+
</nav>
67+
68+
<div class="wy-nav-content">
69+
<div class="rst-content">
70+
<div role="navigation" aria-label="Page navigation">
71+
<ul class="wy-breadcrumbs">
72+
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
73+
<li><a href="index.html">Mezzio: Symfony-Messenger-Bridge</a> &raquo;</li>
74+
<li>Configuration</li>
75+
<li class="wy-breadcrumbs-aside">
76+
</li>
77+
</ul>
78+
<hr/>
79+
</div>
80+
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
81+
<div itemprop="articleBody">
82+
83+
<section id="configuration">
84+
<span id="docs-mezzio-messenger-config"></span><h1>Configuration<a class="headerlink" href="#configuration" title="Permalink to this headline"></a></h1>
85+
<p>The configuration for this bridge is defined under the <code class="docutils literal notranslate"><span class="pre">messageBus</span></code> namespace for the <code class="docutils literal notranslate"><span class="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 <a class="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 <code class="docutils literal notranslate"><span class="pre">data/cache/message-bus</span></code> and <code class="docutils literal notranslate"><span class="pre">data/logs/message-bus</span></code> directories.</p>
91+
<div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="x">&#39;messageBus&#39; =&gt; [</span>
92+
<span class="x"> &#39;logPath&#39; =&gt; dirname(__DIR__, 2).&#39;/data/logs/message-bus&#39;,</span>
93+
<span class="x"> &#39;cachePath&#39; =&gt; dirname(__DIR__, 2).&#39;/data/cache&#39;,</span>
94+
95+
<span class="x"> // ...</span>
96+
<span class="x">],</span>
97+
</pre></div>
98+
</div>
99+
<section id="transports">
100+
<h2>Transports<a class="headerlink" href="#transports" title="Permalink to this headline"></a></h2>
101+
<p>A ‘transport’ defines the channels, where asynchronous messages can be send to. This can be a database and delegated
102+
via Doctrine, a Redis instance or a RabbitMQ. Maybe more to come. To define multiple channels, simply create multiple
103+
DSNs within this configuration.</p>
104+
<div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="x">&#39;messageBus&#39; =&gt; [</span>
105+
<span class="x"> &#39;transportDSNs&#39; =&gt; [</span>
106+
<span class="x"> // name =&gt; DSN,</span>
107+
<span class="x"> &#39;default&#39; =&gt; &#39;amqp://guest:password@rabbitmq.tld:5672/%2f/default&#39;,</span>
108+
<span class="x"> &#39;failure&#39; =&gt; &#39;amqp://guest:password@rabbitmq.tld:5672/%2f/failure&#39;,</span>
109+
<span class="x"> &#39;doctrine&#39; =&gt; &#39;doctrine://guest:password@mariadb10:3306/default&#39;,</span>
110+
<span class="x"> &#39;redis&#39; =&gt; &#39;redis://redis5:6379/default&#39;,</span>
111+
<span class="x"> ],</span>
112+
113+
<span class="x"> // ...</span>
114+
<span class="x">],</span>
115+
</pre></div>
116+
</div>
117+
<p>For each configured transport DSN, a service named <code class="docutils literal notranslate"><span cl 10000 ass="pre">Transport::$name</span></code> will be added to the service container, holding
118+
an instance of <code class="docutils literal notranslate"><span class="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. <code class="docutils literal notranslate"><span class="pre">Transport::default</span></code> - or use the helper
120+
<code class="docutils literal notranslate"><span class="pre">MessageBus\Factory\Transporthelper::createTransportName($name)</span></code> for the <code class="docutils literal notranslate"><span class="pre">$container-&gt;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>
124+
<div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="x">&#39;messageBus&#39; =&gt; [</span>
125+
<span class="x"> &#39;failureTransport&#39; =&gt; MessageBus\Factory\TransportHelper::createTransportName(&#39;failure&#39;),</span>
126+
127+
<span class="x"> // ...</span>
128+
<span class="x">],</span>
129+
</pre></div>
130+
</div>
131+
</section>
132+
<section id="delegating-the-messages">
133+
<h2>Delegating the messages<a class="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 “<a class="reference internal" href="how-to-use.html#docs-mezzio-messenger-how-to"><span class="std std-ref">How to use the bridge</span></a>” section
135+
or in the <a class="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>
137+
<div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="x">&#39;messageBus&#39; =&gt; [</span>
138+
<span class="x"> // ...</span>
139+
140+
<span class="x"> &#39;handlersLocatorMap&#39; =&gt; [</span>
141+
<span class="x"> App\Worker\ImportantSyncMessage::class =&gt; [App\Worker\ImportantWorker::class],</span>
142+
<span class="x"> App\Worker\UnimportantAsyncMessage::class =&gt; App\Worker\UnimportantWorker::class,</span>
143+
<span class="x"> ],</span>
144+
145+
<span class="x"> &#39;sendersLocatorMap&#39; =&gt; [</span>
146+
<span class="x"> App\Worker\UnimportantAsyncMessage::class =&gt; &#39;Transport::default&#39;,</span>
147+
<span class="x"> ],</span>
148+
<span class="x">],</span>
149+
</pre></div>
150+
</div>
151+
<p>A message not listed in the ‘sendersLocatorMap’ will be handle synchronously on request.</p>
152+
</section>
153+
</section>
154+
155+
156+
</div>
157+
</div>
158+
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
159+
<a href="index.html" class="btn btn-neutral float-left" title="Mezzio: Symfony-Messenger-Bridge" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
160+
<a href="how-to-use.html" class="btn btn-neutral float-right" title="How to use the bridge" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
161+
</div>
162+
163+
<hr/>
164+
165+
<div role="contentinfo">
166+
<p>&#169; Copyright 2022, Sengorius.</p>
167+
</div>
168+
169+
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
170+
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
171+
provided by <a href="https://readthedocs.org">Read the Docs</a>.
172+
173+
174+
</footer>
175+
</div>
176+
</div>
177+
</section>
178+
</div>
179+
<script>
180+
jQuery(function () {
181+
SphinxRtdTheme.Navigation.enable(true);
182+
});
183+
</script>
184+
185+
</body>
186+
</html>

0 commit comments

Comments
 (0)
0