Skip to content

Commit ac1144e

Browse files
[CI] Publish Preview for PR #1 7cbe889
1 parent caa5e15 commit ac1144e

File tree

2 files changed

+115
-141
lines changed

2 files changed

+115
-141
lines changed

pull-1/sitemap.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
33
<url>
44
<loc>https://redhat-solution-patterns.github.io/solution-patterns/solution-pattern-event-mesh-for-microservices/01-pattern.html</loc>
5-
<lastmod>2025-01-09T20:43:15.487Z</lastmod>
5+
<lastmod>2025-01-16T21:25:45.110Z</lastmod>
66
</url>
77
<url>
88
<loc>https://redhat-solution-patterns.github.io/solution-patterns/solution-pattern-event-mesh-for-microservices/02-architecture.html</loc>
9-
<lastmod>2025-01-09T20:43:15.487Z</lastmod>
9+
<lastmod>2025-01-16T21:25:45.110Z</lastmod>
1010
</url>
1111
<url>
1212
<loc>https://redhat-solution-patterns.github.io/solution-patterns/solution-pattern-event-mesh-for-microservices/03-demo.html</loc>
13-
<lastmod>2025-01-09T20:43:15.487Z</lastmod>
13+
<lastmod>2025-01-16T21:25:45.110Z</lastmod>
1414
</url>
1515
<url>
1616
<loc>https://redhat-solution-patterns.github.io/solution-patterns/solution-pattern-event-mesh-for-microservices/04-workshop.html</loc>
17-
<lastmod>2025-01-09T20:43:15.487Z</lastmod>
17+
<lastmod>2025-01-16T21:25:45.110Z</lastmod>
1818
</url>
1919
<url>
2020
<loc>https://redhat-solution-patterns.github.io/solution-patterns/solution-pattern-event-mesh-for-microservices/developer-resources.html</loc>
21-
<lastmod>2025-01-09T20:43:15.487Z</lastmod>
21+
<lastmod>2025-01-16T21:25:45.110Z</lastmod>
2222
</url>
2323
<url>
2424
<loc>https://redhat-solution-patterns.github.io/solution-patterns/solution-pattern-event-mesh-for-microservices/index.html</loc>
25-
<lastmod>2025-01-09T20:43:15.487Z</lastmod>
25+
<lastmod>2025-01-16T21:25:45.110Z</lastmod>
2626
</url>
2727
</urlset>

pull-1/solution-pattern-event-mesh-for-microservices/02-architecture.html

Lines changed: 109 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -251,190 +251,164 @@ <h2 id="tech_stack"><a class="anchor" href="#tech_stack"></a><a class="link" hre
251251
<div class="sect1">
252252
<h2 id="in_depth"><a class="anchor" href="#in_depth"></a><a class="link" href="#in_depth">2. An in-depth look at the solution&#8217;s architecture</a></h2>
253253
<div class="sectionbody">
254+
<div class="paragraph">
255+
<p>Building applications around the Event Mesh is a solution that can be applied
256+
either to existing applications or to greenfield projects. The existing
257+
applications can be divided by their domain boundaries. The divided parts might
258+
become modules, or even external services. Those modules will issue commands,
259+
directed towards the Event Mesh, which will be routed towards the configured
260+
endpoints.</p>
261+
</div>
254262
<div class="sect2">
255263
<h3 id="_problem_analysis"><a class="anchor" href="#_problem_analysis"></a><a class="link" href="#_problem_analysis">2.1. Problem Analysis</a></h3>
256264
<div class="paragraph">
257265
<p>Traditional transactional systems enforce strict consistency, which slows
258-
applications and distorts business logic. In our example, Cabs app, must
259-
account for a real-life events like exiting a cab, even if dependent systems
260-
(e.g. invoicing) experience downtime. Throwing errors, while keeps the
261-
consistency in already stored data, loses the new data from real life events.
262-
This leads to a bad impression by the end-users, and distorts the actual
263-
business process.</p>
266+
applications and distorts business logic. In our illustrative Cabs app example,
267+
we must accommodate real-world scenarios, such as exiting a cab, even when
268+
dependent systems (e.g., invoicing) encounter disruptions. Disregarding errors,
269+
which preserve the integrity of existing data, discards the newly generated data
270+
from genuine events. This results in a negative user experience and distorts
271+
the actual business process, leading to potential customer dissatisfaction.</p>
264272
</div>
265273
</div>
266274
<div class="sect2">
267275
<h3 id="_solution_breakdown"><a class="anchor" href="#_solution_breakdown"></a><a class="link" href="#_solution_breakdown">2.2. Solution Breakdown</a></h3>
268276
<div class="paragraph">
269-
<p>Split services into independently operating microservices with distinct responsibilities.</p>
277+
<p>The concept of employing the Event Mesh as a central, reliable hub for dispatching
278+
commands, as events, lies at the heart of this solution. This approach aligns
279+
closely with the Command Query Responsibility Segregation (CQRS) pattern, which
280+
distinctly categorizes commands and queries. Commands, in this context, are
281+
modeled as asynchronous events, designed to undergo processing by the event mesh.
282+
On the other hand, queries are synchronous operations, safe to retry, ensuring
283+
no loss of data integrity due to transient errors.</p>
270284
</div>
271285
<div class="paragraph">
272-
<p>Utilize CQRS to separate commands (asynchronous state changes) from queries (synchronous, retry-safe reads).</p>
286+
<p>The primary responsibility of the Event Mesh is twofold: firstly, it persists
287+
the incoming events, thereby maintaining a record of changes in the system&#8217;s
288+
state. Secondly, it routes these events to their respective endpoints, ensuring
289+
that the appropriate microservices are notified and can subsequently update
290+
their internal states based on the event data.</p>
273291
</div>
274-
</div>
275-
<div class="sect2">
276-
<h3 id="_event_mesh_flow"><a class="anchor" href="#_event_mesh_flow"></a><a class="link" href="#_event_mesh_flow">2.3. Event Mesh Flow</a></h3>
277292
<div class="paragraph">
278-
<p>Events like CompleteTransit are published as CloudEvents to a Knative broker.</p>
293+
<p>The mesh&#8217;s inherent resilience is further bolstered by its exponential backoff
294+
strategy, which it employs when encountering operational failures. This mechanism
295+
ensures that the system retries the operation until it succeeds, thus mitigating
296+
the risk of data loss or system disruption due to transient issues.</p>
279297
</div>
280298
<div class="paragraph">
281-
<p>Triggers route events dynamically to the appropriate microservices.</p>
299+
<p>By integrating the Event Mesh into the system architecture, several architectural
300+
benefits are achieved:</p>
282301
</div>
283-
<div class="paragraph">
284-
<p>Services process events, update state, and emit new events for downstream consumers.</p>
302+
<div class="ulist">
303+
<ul>
304+
<li>
305+
<p><strong>Decomposition of the application into independently functioning services</strong>:
306+
This approach facilitates a division of labor, with each service handling
307+
specific responsibilities. This not only enhances maintainability but also
308+
fosters scalability, as services can be independently scaled based on their
309+
demands.</p>
310+
</li>
311+
<li>
312+
<p><strong>Correction of systemic issues</strong>:
313+
The Event Mesh&#8217;s error-handling mechanism, through retries and event
314+
persistence, aids in minimizing the impact of failures on the end user.
315+
This is crucial as it prevents bugs and outages from becoming visible to
316+
the user, thereby preserving the system&#8217;s perceived responsiveness.</p>
317+
</li>
318+
<li>
319+
<p><strong>Enhanced system performance</strong>:
320+
The system becomes more responsive, as the end user no longer needs to
321+
wait for multiple, often independent, operations to complete successfully.
322+
The Event Mesh&#8217;s event-driven model, coupled with the retries and event
323+
persistence, ensures that critical state changes are propagated swiftly and
324+
reliably, thereby improving the overall user experience.</p>
325+
</li>
326+
</ul>
285327
</div>
286328
</div>
287329
<div class="sect2">
288-
<h3 id="_using_images"><a class="anchor" href="#_using_images"></a><a class="link" href="#_using_images">2.4. Using images</a></h3>
330+
<h3 id="_event_mesh_flow"><a class="anchor" href="#_event_mesh_flow"></a><a class="link" href="#_event_mesh_flow">2.3. Event Mesh Flow</a></h3>
331+
<div class="ulist">
332+
<ul>
333+
<li>
334+
<p>Events are published as CloudEvents to a Knative&#8217;s Event Mesh.</p>
335+
</li>
336+
<li>
337+
<p>Triggers route events dynamically to the appropriate endpoints.</p>
338+
</li>
339+
<li>
340+
<p>Services process events, update state, and emit new events for downstream
341+
consumers.</p>
342+
</li>
343+
</ul>
344+
</div>
289345
<div class="imageblock">
290346
<div class="content">
291-
<img src="_images/red_hat_open-hybrid-cloud.png" alt="red hat open hybrid cloud" width="30%">
347+
<img src="https://www.plantuml.com/plantuml/svg/VP1DJiCm58JtFiMZ-rmWYwgqeHkeX2WNUBK7Ok4ubdyYzVQuZKbe5TZ5olTcFiqcHFOnTKOyn1OTIC8d0xPLdwBH5iBb_rfgnpRIwWMVBC_qwDoAED3ul4MUBKSzW9u6vES1eRsYMzz_mT-YZS-W3tJeLUwyOdlW23zeYJkK8vyuZ52p5O9bRk687uTYLgrB4zNqcav6XvPsR6GocTsZQ8d2L1aV3slQzVP3-uuKpCNgB1JkEwQpzI_FcjxoL5XgcUvdMioVL4soi-iuIOQcE5N259RYPgKYMNJ-3lfdkMPRqp7s7lJkjQFBvWihR61Lwimt" alt="VP1DJiCm58JtFiMZ rmWYwgqeHkeX2WNUBK7Ok4ubdyYzVQuZKbe5TZ5olTcFiqcHFOnTKOyn1OTIC8d0xPLdwBH5iBb rfgnpRIwWMVBC qwDoAED3ul4MUBKSzW9u6vES1eRsYMzz mT YZS W3tJeLUwyOdlW23zeYJkK8vyuZ52p5O9bRk687uTYLgrB4zNqcav6XvPsR6GocTsZQ8d2L1aV3slQzVP3 uuKpCNgB1JkEwQpzI FcjxoL5XgcUvdMioVL4soi iuIOQcE5N259RYPgKYMNJ 3lfdkMPRqp7s7lJkjQFBvWihR61Lwimt" width="100%">
292348
</div>
293349
</div>
294350
<div class="paragraph">
295-
<p></p>
296-
</div>
351+
<p>The diagram illustrates the flow of events between the legacy application, the Knative Event Mesh, the fee calculator service, and the datastore.</p>
297352
</div>
298-
<div class="sect2">
299-
<h3 id="_embedding_html"><a class="anchor" href="#_embedding_html"></a><a class="link" href="#_embedding_html">2.5. Embedding HTML</a></h3>
300-
<br>
301-
<h3> Embed HTML by surrounding it with with four +s before and after. </h3>
302-
<span>View the ascii doc to learn more</span>
303-
<br>
304353
</div>
305354
<div class="sect2">
306-
<h3 id="_different_decorators"><a class="anchor" href="#_different_decorators"></a><a class="link" href="#_different_decorators">2.6. Different decorators</a></h3>
307-
<div class="admonitionblock tip">
308-
<table>
309-
<tr>
310-
<td class="icon">
311-
<i class="fa icon-tip" title="Tip"></i>
312-
</td>
313-
<td class="content">
355+
<h3 id="_supporting_legacy_systems"><a class="anchor" href="#_supporting_legacy_systems"></a><a class="link" href="#_supporting_legacy_systems">2.4. Supporting Legacy Systems</a></h3>
314356
<div class="paragraph">
315-
<p>This is a Tip</p>
316-
</div>
317-
</td>
318-
</tr>
319-
</table>
320-
</div>
321-
<div class="admonitionblock note">
322-
<table>
323-
<tr>
324-
<td class="icon">
325-
<i class="fa icon-note" title="Note"></i>
326-
</td>
327-
<td class="content">
328-
<div class="paragraph">
329-
<p>This is a NOTE</p>
330-
</div>
331-
</td>
332-
</tr>
333-
</table>
334-
</div>
335-
<div class="admonitionblock warning">
336-
<table>
337-
<tr>
338-
<td class="icon">
339-
<i class="fa icon-warning" title="Warning"></i>
340-
</td>
341-
<td class="content">
342-
<div class="paragraph">
343-
<p>This is a WARNING</p>
344-
</div>
345-
</td>
346-
</tr>
347-
</table>
348-
</div>
349-
<div class="admonitionblock important">
350-
<table>
351-
<tr>
352-
<td class="icon">
353-
<i class="fa icon-important" title="Important"></i>
354-
</td>
355-
<td class="content">
356-
<div class="paragraph">
357-
<p>This is IMPORTANT</p>
358-
</div>
359-
</td>
360-
</tr>
361-
</table>
357+
<p>One of the strengths of an event mesh architecture is its ability to integrate seamlessly with legacy systems, making them more resilient and adaptable. Legacy applications can be retrofitted to produce and consume events through lightweight adapters. For instance:</p>
362358
</div>
363-
</div>
364-
<div class="sect2">
365-
<h3 id="_creating_tables"><a class="anchor" href="#_creating_tables"></a><a class="link" href="#_creating_tables">2.7. Creating tables</a></h3>
366-
<table class="tableblock frame-all grid-all stretch">
367-
<colgroup>
368-
<col style="width: 33.3333%;">
369-
<col style="width: 33.3333%;">
370-
<col style="width: 33.3334%;">
371-
</colgroup>
372-
<tbody>
373-
<tr>
374-
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
375-
<p><strong>Column A</strong></p>
376-
</div></div></td>
377-
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
378-
<p>Column <strong>A</strong></p>
379-
</div></div></td>
380-
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
381-
<p><em>Column C</em></p>
382-
</div></div></td>
383-
</tr>
384-
<tr>
385-
<td class="tableblock halign-left valign-top"><div class="content"><div class="ulist">
359+
<div class="ulist">
386360
<ul>
387361
<li>
388-
<p>Lorem Ipsum</p>
362+
<p>A monolithic Java application can send events for specific operations, like CompleteTransit, instead of handling all logic internally.</p>
389363
</li>
390364
<li>
391-
<p>Lorem Ipsum</p>
392-
</li>
393-
</ul>
394-
</div></div></td>
395-
<td class="tableblock halign-left valign-top"><div class="content"><div class="ulist">
396-
<ul>
397-
<li>
398-
<p>Lorem Ipsum</p>
365+
<p>Event listeners can be introduced incrementally, enabling the legacy app to subscribe to events like DriverFeeCalculated without refactoring its core logic.</p>
399366
</li>
400367
<li>
401-
<p>Lorem Ipsum</p>
368+
<p>This approach decouples old systems from rigid workflows, allowing for gradual modernization while ensuring operational continuity.</p>
402369
</li>
403370
</ul>
404-
</div></div></td>
405-
<td class="tableblock halign-left valign-top"><div class="content"><div class="ulist">
406-
<ul>
407-
<li>
408-
<p>Lorem Ipsum</p>
409-
</li>
410-
<li>
411-
<p>Lorem Ipsum</p>
412-
</li>
413-
</ul>
414-
</div></div></td>
415-
</tr>
416-
</tbody>
417-
</table>
371+
</div>
418372
</div>
419373
<div class="sect2">
420-
<h3 id="_content_that_can_be_copied"><a class="anchor" href="#_content_that_can_be_copied"></a><a class="link" href="#_content_that_can_be_copied">2.8. Content that can be copied</a></h3>
374+
<h3 id="_improving_resilience_in_traditional_applications"><a class="anchor" href="#_improving_resilience_in_traditional_applications"></a><a class="link" href="#_improving_resilience_in_traditional_applications">2.5. Improving Resilience in Traditional Applications</a></h3>
421375
<div class="paragraph">
422-
<p>Click below to copy the content</p>
376+
<p>Traditional systems often rely on synchronous calls and transactions, which can cascade failures across components. Replacing these with asynchronous event-driven communication reduces dependencies.</p>
423377
</div>
424-
<div class="listingblock console-input">
425-
<div class="content">
426-
<pre class="highlightjs highlight"><code class="language-shell script hljs" data-lang="shell script">oc version #openshift cli client
427-
oc login --token=&lt;token&gt; --server=&lt;server&gt;</code></pre>
378+
<div class="paragraph">
379+
<p>For example, invoicing and notification services in an e-commerce platform can process OrderPlaced events independently, ensuring that downtime in one service does not block the entire order workflow.</p>
428380
</div>
381+
<div class="paragraph">
382+
<p>Retry mechanisms provided by the event mesh guarantee that transient failures are handled gracefully without data loss.</p>
429383
</div>
430384
</div>
431385
</div>
432386
</div>
433387
<div class="sect1">
434-
<h2 id="more_tech"><a class="anchor" href="#more_tech"></a><a class="link" href="#more_tech">3. About the Technology Stack</a></h2>
388+
<h2 id="more_tech"><a class="anchor" href="#more_tech"></a><a class="link" href="#more_tech">3. More about the Technology Stack</a></h2>
435389
<div class="sectionbody">
436390
<div class="paragraph">
437-
<p>If you want to include more details about the tech stack you used, this is the place.</p>
391+
<p>It&#8217;s worth noting that <em>Knative&#8217;s Event Mesh</em> is completely transparent to the
392+
applications. The applications publish and consume events, usually via
393+
<em>HTTP REST</em>, and the only thing that is required is the <em>CloudEvents</em> format.</p>
394+
</div>
395+
<div class="paragraph">
396+
<p>The <em>CloudEvents</em> format provides a common envelope for events with metadata
397+
that every event needs, such as identifier, type, timestamps, or source
398+
information. The format is a CNCF standard supported by a number of projects and
399+
doesn&#8217;t enforce the use of any library.</p>
400+
</div>
401+
<div class="paragraph">
402+
<p>This makes the investment in <em>Knative&#8217;s Event Mesh</em> safe in terms of vendor
403+
lock-in. Architects can be assured that their options remain open and that
404+
solutions can be easily reconfigured down the road.</p>
405+
</div>
406+
<div class="paragraph">
407+
<p>What&#8217;s more, relying on well-known and easy-to-deploy <em>CloudEvents</em>, typically
408+
over <em>HTTP</em>, makes testing simple and straightforward. Developers don&#8217;t need
409+
complex development environments because the <em>Event Mesh</em> integration can be
410+
easily tested with regular <em>REST</em> send or receive tests that most developers
411+
are familiar with.</p>
438412
</div>
439413
</div>
440414
</div>

0 commit comments

Comments
 (0)