Skip to content

Commit 4c4c814

Browse files
[CI] Publish Preview for PR #1 048176e
1 parent 8afe587 commit 4c4c814

File tree

2 files changed

+78
-21
lines changed

2 files changed

+78
-21
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-24T16:18:17.609Z</lastmod>
5+
<lastmod>2025-01-30T13:22:17.017Z</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-24T16:18:17.609Z</lastmod>
9+
<lastmod>2025-01-30T13:22:17.017Z</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-24T16:18:17.609Z</lastmod>
13+
<lastmod>2025-01-30T13:22:17.017Z</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-24T16:18:17.609Z</lastmod>
17+
<lastmod>2025-01-30T13:22:17.017Z</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-24T16:18:17.609Z</lastmod>
21+
<lastmod>2025-01-30T13:22:17.017Z</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-24T16:18:17.609Z</lastmod>
25+
<lastmod>2025-01-30T13:22:17.017Z</lastmod>
2626
</url>
2727
</urlset>

pull-1/solution-pattern-event-mesh-for-microservices/03-demo.html

Lines changed: 72 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -176,29 +176,29 @@ <h1 id="_see_the_solution_in_action" class="sect0"><a class="anchor" href="#_see
176176
<h2 id="_demonstration"><a class="anchor" href="#_demonstration"></a><a class="link" href="#_demonstration">1. Demonstration</a></h2>
177177
<div class="sectionbody">
178178
<div class="paragraph">
179-
<p>Let&#8217;s take a look at the example.
179+
<p>Let&#8217;s take a look at the following example.
180180
We&#8217;ll be looking at a Cabs ride-sharing application, that mimics real-world solutions of similar kind.
181181
The application is written in a popular Java framework.</p>
182182
</div>
183183
<div class="sect2">
184184
<h3 id="_initial_application"><a class="anchor" href="#_initial_application"></a><a class="link" href="#_initial_application">1.1. Initial application</a></h3>
185-
<div class="paragraph">
186-
<p>Here&#8217;s a method from the Cabs application that handles the completion of transit:</p>
187-
</div>
188-
<div class="admonitionblock warning">
185+
<div class="admonitionblock important">
189186
<table>
190187
<tr>
191188
<td class="icon">
192-
<i class="fa icon-warning" title="Warning"></i>
189+
<i class="fa icon-important" title="Important"></i>
193190
</td>
194191
<td class="content">
195192
<div class="paragraph">
196-
<p>The following example should be considered an anti-example!</p>
193+
<p>The following example should be considered as suboptimal, most likely a counterexample!</p>
197194
</div>
198195
</td>
199196
</tr>
200197
</table>
201198
</div>
199+
<div class="paragraph">
200+
<p>Here&#8217;s a method from the Cabs application that handles the completion of a ride.</p>
201+
</div>
202202
<div class="listingblock">
203203
<div class="content">
204204
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@Transactional <i class="conum" data-value="1"></i><b>(1)</b>
@@ -230,27 +230,84 @@ <h3 id="_initial_application"><a class="anchor" href="#_initial_application"></a
230230
}</code></pre>
231231
</div>
232232
</div>
233+
<div class="admonitionblock caution">
234+
<table>
235+
<tr>
236+
<td class="icon">
237+
<i class="fa icon-caution" title="Caution"></i>
238+
</td>
239+
<td class="content">
233240
<div class="paragraph">
234-
<p>There are a number of problems with that method:</p>
241+
<p>There are issues with the above method.</p>
235242
</div>
236243
<div class="colist arabic">
237244
<table>
238245
<tr>
239246
<td><i class="conum" data-value="1"></i><b>1</b></td>
240-
<td>It uses the <code>@Transational</code> annotation, and modify number of data stores.
241-
This means that when one of those operations fails, the whole processing will be rolled back.
242-
In effect, the end-user will receive a nasty error message.</td>
247+
<td>It uses the <code>@Transational</code> annotation, and modify number of unrelated data stores.</td>
243248
</tr>
244249
<tr>
245250
<td><i class="conum" data-value="2"></i><b>2</b></td>
246-
<td>It merges different, business domains.
247-
This makes it hard to understand and maintain.
248-
It isn&#8217;t required to all of those operations complete at the same time.</td>
251+
<td>It merges different, business domains.</td>
252+
</tr>
253+
</table>
254+
</div>
255+
</td>
256+
</tr>
257+
</table>
258+
</div>
259+
<div class="paragraph">
260+
<p>Similar methods are, unfortunately, quite common in business applications.
261+
At first glance, many developers don&#8217;t see any problems with similar code.
262+
Let&#8217;s break down the problems in detail.</p>
263+
</div>
264+
<div class="sect3">
265+
<h4 id="_overuse_of_transactional_processing"><a class="anchor" href="#_overuse_of_transactional_processing"></a><a class="link" href="#_overuse_of_transactional_processing">1.1.1. Overuse of transactional processing</a></h4>
266+
<div class="paragraph">
267+
<p>The transactional processing has been the cornerstone of many business applications.
268+
However, in most cases, the transactional processing isn&#8217;t the best fit for real-world processes.</p>
269+
</div>
270+
<div class="paragraph">
271+
<p>In our example, when the ride finishes, that&#8217;s a real-world situation.
272+
However, the example uses the <code>@Transational</code> annotation, and operate on number of unrelated data.
273+
This means that when one of those operations fails, the whole processing will be rolled back.
274+
In effect, the end-user will receive a nasty error message.</p>
275+
</div>
276+
<div class="admonitionblock note">
277+
<table>
278+
<tr>
279+
<td class="icon">
280+
<i class="fa icon-note" title="Note"></i>
281+
</td>
282+
<td class="content">
283+
<div class="paragraph">
284+
<p>Outages from the dependant services must not invalidate the main intent.
285+
In fact, all the operations in this example could happen independently, and at different, yet reasonable times.</p>
286+
</div>
287+
</td>
249288
</tr>
250289
</table>
251290
</div>
291+
</div>
292+
<div class="sect3">
293+
<h4 id="_bundling_of_different_logical_domains"><a class="anchor" href="#_bundling_of_different_logical_domains"></a><a class="link" href="#_bundling_of_different_logical_domains">1.1.2. Bundling of different logical domains</a></h4>
294+
<div class="paragraph">
295+
<p>Our example is also very chatty, and hard to understand at first glance.
296+
In fact, this is quite common in similar applications.
297+
The code starts small, easy to understand.
298+
When new features are added, it keeps growing as developers cramp new instructions into methods like <code>completeTransit</code>.</p>
299+
</div>
300+
<div class="paragraph">
301+
<p>Of course, the developers could re-architect the code, to extract instructions to a separate blocks, but that is just a half-measure.
302+
Still, the application will do all the operations, starting from <code>completeTransit</code> method in the same time, and withing the same <em>"script"</em>.</p>
303+
</div>
304+
</div>
305+
</div>
306+
<div class="sect2">
307+
<h3 id="_refactoring"><a class="anchor" href="#_refactoring"></a><a class="link" href="#_refactoring">1.2. Refactoring</a></h3>
252308
<div class="paragraph">
253-
<p>Include here content related to potential existing demos: blogs, articles, recorded videos, walkthrough guides, tutorials.</p>
309+
<p>In this section, we&#8217;ll refactor the Cabs application.
310+
The refactoring will be limited to make the process easy to understand.</p>
254311
</div>
255312
<div class="imageblock">
256313
<div class="content">

0 commit comments

Comments
 (0)