----------------------------------------------------------------------
Sessions-3 : File Connector - OnNewOrUpdateFile
----------------------------------------------------------------------
Exercise 03 : Poll for a new file
---------------------------------
Agenda : Checking For a new file exisits in the give folder, if file exits read the
contents of the file.
Create a folder structure, Create a file inside it (C:\Fileops\read).
students.csv
-----------
sno,sname,m1,m2
1,raju,10,20
2,rani,20,30
Steps :
--------
1. Create a new Project
2. Add the file connector to project.
Mule pallet --> Add modules --> Select File module --> Drag drop on Pallet.
3. Create the flow
a) File --> On New Or Update File. (poll for given path in interval of time)
Conf Properties :
1. Connector Configurations --> New configruation --> 'Ok'.
2. Directory : Provide path to poll for a new file
3. Matcher : Edit Inline
FileName pattern: *.*
4. Scheduling Strategy : Fixed Frequency
Freq : 2
Time unit : Minutes
5. Auto Delete : True
6. Move to Directory : C:\Fileops\archive
b) Add a logger :
4) Testing :
a) Place a file in the "configured Directory"
b) Run the Program.
c) Output :
File will read and log will be printed in the console.
5) Extra Practice :
a) Debug the project and observe the attributes and payload.
b) Changes in code
logger --> Properties
Message : select 'fx' and type payload.
test the application, in logger you can see the contents of the file.