<?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: WB</title>
    <description>The latest articles on DEV Community by WB (@rofako).</description>
    <link>https://dev.to/rofako</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%2F1237515%2Fbd248a32-dbc1-4aaf-a734-058f671423f2.png</url>
      <title>DEV Community: WB</title>
      <link>https://dev.to/rofako</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rofako"/>
    <language>en</language>
    <item>
      <title>Hello Mule (MUnit)</title>
      <dc:creator>WB</dc:creator>
      <pubDate>Wed, 27 Dec 2023 17:05:19 +0000</pubDate>
      <link>https://dev.to/rofako/hello-mule-munit-16d</link>
      <guid>https://dev.to/rofako/hello-mule-munit-16d</guid>
      <description>&lt;p&gt;In the previous post, we implemented a mule application that read a file from an inbox directory, processed its content and moved the file into an outbox directory.&lt;br&gt;
In this post, we are going to write a unit test for that integration. Let's go!&lt;/p&gt;

&lt;p&gt;Right click on the helloworld project and select &lt;code&gt;new MUnit Test&lt;/code&gt;.&lt;br&gt;
Select the flow that you are trying to unittest, set a name for the unit test and press &lt;code&gt;Finish&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftb3hs7y99t560f04o16d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftb3hs7y99t560f04o16d.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you have an empty Unit Test for your flow that we are going to implement.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsebyg7xmt8c4fc7wbby3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsebyg7xmt8c4fc7wbby3.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What can we test in this flow? Our application performs 3 main tasks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read the file from the inbox directory&lt;/li&gt;
&lt;li&gt;Process the file content&lt;/li&gt;
&lt;li&gt;Move the file into the outbox directory&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By testing task 2, we are effectively also testing task 1. After that, we can check that the file has effectively been moved into the outbox directory.&lt;br&gt;
But before we get to writing the unit test, we need to modify the flow from the previous post. We had hardcoded the inbox path into the flow, which makes testing not flexible. We do not want to use the same path at runtime and at test time.&lt;br&gt;
Let's create a global config and externalize the working directories.&lt;br&gt;
Go back to the helloworld-flow and select the &lt;code&gt;Global Elements&lt;/code&gt; tab&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fylgvz582izgo372hzxz6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fylgvz582izgo372hzxz6.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Edit the file_Config configuration and replace the hardcoded working directory path with the followingn placeholder parameter: &lt;code&gt;${file.helloworld.inboxDir}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft3ntt4videgcowboqkaa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft3ntt4videgcowboqkaa.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Right click on &lt;code&gt;src/main/resources&lt;/code&gt; and select new file. Give it the name config.yaml&lt;br&gt;
Enter the lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;file:
  helloworld:
    inboxDir: C:/dev/Mulesoft/tutorial
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and save the file.&lt;/p&gt;

&lt;p&gt;We need to tell Mule to read the newly created file to find the configured placeholder. We do this by creating a "Global configuration properties".&lt;br&gt;
Go back to the tab &lt;code&gt;Global Elements&lt;/code&gt; and click the &lt;code&gt;Create&lt;/code&gt; button.&lt;br&gt;
Under "Global configurations", select &lt;code&gt;Configuration properties&lt;/code&gt;,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqrpqcxp6sw7hg4cjdz4x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqrpqcxp6sw7hg4cjdz4x.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
Press &lt;code&gt;Ok&lt;/code&gt; and enter the name of the configuration file you created &lt;code&gt;config.yaml&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftnwt5kxcfg9hdedvireo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftnwt5kxcfg9hdedvireo.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With that, we have externalized the path of the working directory and can use a different path in the unit test by using another property file only for the test. This is what we are going to do next:&lt;br&gt;
Right Click &lt;code&gt;src/test/resources&lt;/code&gt; and create a new File. Give it the name &lt;code&gt;test-config.yaml&lt;/code&gt;.&lt;br&gt;
In that file enter the following lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;file:
  helloworld:
    inboxDir: src/test/resources/tutorial
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is going to be the working directory for our unit test.&lt;br&gt;
In the &lt;code&gt;Global Elements&lt;/code&gt; Tab of our unit test, add a new &lt;code&gt;Configuration properties&lt;/code&gt; and set the file name to &lt;code&gt;test-config.yaml&lt;/code&gt;. This way, MUnit is going to resolve placeholder properties by looking into that file.&lt;br&gt;
To activate the file connector during test,&lt;br&gt;
enter the following snippet under the &lt;code&gt;&amp;lt;munit:test&amp;gt;&lt;/code&gt; tag in the configuration xml&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      &amp;lt;munit:enable-flow-sources&amp;gt;
           &amp;lt;munit:enable-flow-source value="hello-worldFlow"/&amp;gt;
         &amp;lt;/munit:enable-flow-sources&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or you can use the General Properties Tab of the test suite:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl7taa3fsm1wbd13rwmze.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl7taa3fsm1wbd13rwmze.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here we enable the file connector, so that it can start polling the inbox directory during the unit test.&lt;br&gt;
Now you can run your unit test. When it's done, you will get an error, because the directory &lt;code&gt;tutorial&lt;/code&gt; is missing. Create 3 new directories tutorial, tutorial/inbox, tutorial/outbox &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F18nun8v2kmhojnczk9ct.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F18nun8v2kmhojnczk9ct.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now run you unit test and you will have a green line.&lt;br&gt;
Sadly, we haven't really testes anything yet. We have just made sure that your testing environment is setup correclty. &lt;/p&gt;

&lt;p&gt;Now we need to drop a file with a content into the inbox directory, and check the content in our unit test to make sure that the processor is working fine.&lt;br&gt;
Let's configure a validation by adding an assertion to check the content of the file from tin inbox directory. We want to drop a file with the content "Hello World" in that directory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fttw33szq02tm7pvwy9pw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fttw33szq02tm7pvwy9pw.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here we assert that the payload is equals to "Hello World". We have also added a logger in the unit test to be able to read the message in the console.&lt;br&gt;
If you run this test, it will fail. Since we have enabled the file connector in the unit test, it is going to be running concurrently with MUnit itself on a different thread and MUnit will jump straight to the validation section of the unit test without waiting for the file connector to read from the directory. This is a tricky scenario, because the Unit Test should be synchronous with the event source in this case. A solution could be to disable the flow source in the unit test, and feed it a payload from another file connector.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs7kxq60odtlxm76lzr89.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs7kxq60odtlxm76lzr89.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now what we need is to add a beforeTest processor to create a file into the inbox directory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8qjw8y8bn1s5awn50yyg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8qjw8y8bn1s5awn50yyg.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwtzz19eqbbliq6lcn80p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwtzz19eqbbliq6lcn80p.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now your unit test should go green.&lt;/p&gt;

&lt;p&gt;THis is still not satisfactory, because the reference flow had to be disabled. The test.txt file stays in the inbox directory and is not being moved into the oubox directory.&lt;br&gt;
In the next post, we will describe how to fix this issue so we can test a file connector without hacing to disable it in the unit test.&lt;br&gt;
Stay tuned.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Hello Mule (Mulesoft)</title>
      <dc:creator>WB</dc:creator>
      <pubDate>Thu, 21 Dec 2023 19:39:19 +0000</pubDate>
      <link>https://dev.to/rofako/hello-mule-mulesoft-2nmd</link>
      <guid>https://dev.to/rofako/hello-mule-mulesoft-2nmd</guid>
      <description>&lt;p&gt;This post is the first of a series of articles about system integration in the enterprise. We will approach the topic from first principles and gradually expand into real world scenarios. &lt;/p&gt;

&lt;h2&gt;
  
  
  What is System Integration?
&lt;/h2&gt;

&lt;p&gt;System integration is everything. Anytime 2 "things" need to communicate with eachother, they are actually "integrating" with one another. Over the years, system integration has come to mean the process of integrating heterogeneous systems. These are systems that have clear boundaries between eachother, usually built by different teams to address different concerns, but need to talk to eachother by exchanging messages. A data warehouse system (DWS) may need to be aware of all the items that were ordered during the day for analytics purposes. An oder-management system (OMS) will then have to report the relevant data to the DWS. There need to be a way to exchange messages between the 2 systems in a reliable and robust way. One tried and tested solution is the use of files as exchange mechanism. Here we have an inbox directory, in which the OMS will drop the files with the list of items sold during the day, and the DWS will read them for processing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuf094gk1ilv3ys9vep6b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuf094gk1ilv3ys9vep6b.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next section, we will implement a solution to this simple yet intricate process. We will start with a local file exchange and then continue with a SFTP Server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mule
&lt;/h2&gt;

&lt;p&gt;System Integration is difficult to implement right. There are a lot of great tools available on the market to help make the task of the system integrator easy. Some of the tools will be touched in this blogs serie, but the main focus will be on Mule, and sometimes we will compare the Mule solution with Apache Camel or Spring Integration. &lt;/p&gt;

&lt;h2&gt;
  
  
  Hello Mule
&lt;/h2&gt;

&lt;p&gt;File exchange is the "helloworld" of system integration. Let's implement files exchange with &lt;a href="https://anypoint.mulesoft.com" rel="noopener noreferrer"&gt;Anypoint Studio&lt;/a&gt;&lt;br&gt;
If you have ever worked with eclipse before, you will feel right at home because anypoint studio is based on the eclipse platform.&lt;br&gt;
Let's jump right into it:&lt;/p&gt;

&lt;p&gt;Go to &lt;br&gt;
File -&amp;gt; New -&amp;gt; Mule Project&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh0wb2a80hunw6u7inyh7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh0wb2a80hunw6u7inyh7.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the "Mule Palette", enter "File" in the search box.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs95qfj6ucmebq6sluykv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs95qfj6ucmebq6sluykv.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
You will get the list of file connectors available. The one we are going to use, is the "On new or Updated File". This connector will monitor a directory for any new or updated file and trigger processing. Drag and drop it on the blank canvas&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F64w78yxr1hr6mbbu1yxt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F64w78yxr1hr6mbbu1yxt.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select the connector to activate its configuration:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo26rc2ch5xhofpsxm4s4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo26rc2ch5xhofpsxm4s4.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Under "Basic Settings", add a new connector configuration by clicking the + button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqwk8nufgc5pmn74j89qe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqwk8nufgc5pmn74j89qe.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose a working directory on your machine and click "Ok". I have created mine under &lt;code&gt;C:\dev\Mulesoft\tutorial&lt;/code&gt;&lt;br&gt;
In the "General" configuration panel, set the directory to "inbox", the Matcher to "Edit inline" and the filename pattern to "*.txt"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxu3hvrvfx15s0kj76uuc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxu3hvrvfx15s0kj76uuc.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Mule will be watching for *.txt files in the directory &lt;code&gt;C:\dev\Mulesoft\tutorial\inbox&lt;/code&gt;. You have to make sure that you have created the &lt;code&gt;inbox&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;Scroll down and locate the Scheduling Strategy. Make sure it is "Fixed frequency". Leave "Frequency" to 1000 and TimeUnit to MILLISECONDS. Mule will be monitory the &lt;code&gt;inbox&lt;/code&gt; directory every 1000 milliseconds (1 second).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ejvhyjlic8olymajn91.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ejvhyjlic8olymajn91.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scroll down to the "Post processing action" section and enter directory to move the *.txt files to. Make sure that directory exists.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyxivnsjs4hy62o2s9a2q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyxivnsjs4hy62o2s9a2q.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We are almost ready to test our application. What is missing is a processor that will process the files as they are being read from the inbox directory. We are going to add a simple Logger which purpose is to output the content of the file that are being loaded by mule.&lt;br&gt;
In the "Mule Palette", enter "logger"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq6xwaxc2k0bbp3j580a7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq6xwaxc2k0bbp3j580a7.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select the "Logger" processor and drag and drop into the flow after the file connector.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ys3ypxtebx38g0xjxkh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ys3ypxtebx38g0xjxkh.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Right click the canvas and select &lt;code&gt;Run project&lt;/code&gt;. Wait until the application has been deployed by looking in the Console.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuxl6zobjj1qmope3xvm4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuxl6zobjj1qmope3xvm4.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create a file &lt;code&gt;test.txt&lt;/code&gt; and drop it into the &lt;code&gt;inbox&lt;/code&gt; directory. The file will be moved automatically to the &lt;code&gt;outbox&lt;/code&gt;directory by the mule application.&lt;br&gt;
In the console window, observe how the Logger processor is logging the file read from the inbox directory.&lt;/p&gt;

&lt;p&gt;If you have made it to this point, congratulations. In the next posts, we will look into unit testing the application with MUnit. We will also show how to read the content of the file.&lt;br&gt;
Stay tuned.&lt;/p&gt;

</description>
      <category>integration</category>
      <category>apachecamel</category>
      <category>mulesofthackathon</category>
      <category>springintegration</category>
    </item>
  </channel>
</rss>
