[go: up one dir, main page]

0% found this document useful (0 votes)
47 views1 page

Day 04 Example 03 FilePolling

The document discusses polling for a new file using Mule's file connector. It provides steps to create a Mule project that uses the file connector configured to monitor a directory for new files and read the contents. When a new file is detected, it will be logged and moved to an archive folder.

Uploaded by

Anil S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views1 page

Day 04 Example 03 FilePolling

The document discusses polling for a new file using Mule's file connector. It provides steps to create a Mule project that uses the file connector configured to monitor a directory for new files and read the contents. When a new file is detected, it will be logged and moved to an archive folder.

Uploaded by

Anil S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

----------------------------------------------------------------------

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.

You might also like