<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: mahfuzulamin</title>
    <description>The latest articles on DEV Community by mahfuzulamin (@mahfuzulamin).</description>
    <link>https://dev.to/mahfuzulamin</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F626921%2F05a60a19-026d-4d8a-9673-ea6ffcb5ad2d.jpeg</url>
      <title>DEV Community: mahfuzulamin</title>
      <link>https://dev.to/mahfuzulamin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mahfuzulamin"/>
    <language>en</language>
    <item>
      <title>Zeebe Message Correlation Java</title>
      <dc:creator>mahfuzulamin</dc:creator>
      <pubDate>Fri, 07 May 2021 04:49:05 +0000</pubDate>
      <link>https://dev.to/mahfuzulamin/zeebe-message-correlation-java-36h9</link>
      <guid>https://dev.to/mahfuzulamin/zeebe-message-correlation-java-36h9</guid>
      <description>&lt;p&gt;We could not find any clear working example of Zeebe message correlation when we needed to implement it. After trying different things we have figured out how it works. This project simulates packaging multiple items in a order with message correlation where order id is the unique key.   &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The workflow BPMN: The BPMN file is included in the resources of the github project.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---x09u-NX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/otqbbds49vwx28zbjamp.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---x09u-NX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/otqbbds49vwx28zbjamp.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For single item the bottom flow gets executed based on the condition.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BuaRGxYa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0fqlad24jfwg652s2x7l.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BuaRGxYa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0fqlad24jfwg652s2x7l.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For multiple items message gets correlated in “Collect Items” Receive Task and collected item count gets incremented upon receiving a new message. It runs through the loop at the top the diagram until total number of items are received. This is implemented in the PackageItemsJobHandler of this Java project.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Message correlation workflow setting in the BPMN file&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VRGM7q1O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9lnhyq2663w43icjykuy.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VRGM7q1O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9lnhyq2663w43icjykuy.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Workflow instance with 2 items to package is&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WFYgtolI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/42ab3lf131fh7kxqsbm3.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WFYgtolI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/42ab3lf131fh7kxqsbm3.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Timeout is implemented so that it doesn’t wait in the loop forever if next messages are not sent. In this project 5 minutes is passed as timeout to Zeeke workflow. Interrupting timer boundary event is included to timeout after a duration which is provided as expression by accessing a variable.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5zNeL6Sb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b5vfmpq4540gwtjlt2rz.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5zNeL6Sb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b5vfmpq4540gwtjlt2rz.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The complete project is available on github &lt;a href="https://github.com/mahfuzulamin/zeebe-message-correlation-java"&gt;https://github.com/mahfuzulamin/zeebe-message-correlation-java&lt;/a&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>zeebe</category>
      <category>message</category>
      <category>correation</category>
    </item>
  </channel>
</rss>
