MuleESB
Input and output flow: how to use file and logger
component
Open Anypoint Studio
Create a File  New  Mule
Project
Click «Finish»
Expandthe«myfirstproject»onpackage
explorer
Doubleclickonmyfirstproject.xml
Oncefileisopen,showMessageFlow
FromMulePaletteview,searchfor‘File’
and‘Logger’and selectthefirstone.
DragandDropFilethenJavaandthen
againFilecomponent intoMessageFlow
view.
NowwehavetoconfigurethetwoFile
componentsforourflow
Create3localfolders,whereafilewillbe
createdandstoredbytheflow.
ConfiguretheFile_Input(1°block)and
theFile_Output(2°block),andgivethe
Pathtoinsert,backupandgetoutthefile.
ClickonSAVEattop-leftofscreen
ConfiguretheLoggercomponenttoprint
outtheflowmessageaboutthefilewe
aretransferring(showonConsole).
ClickonSAVEattop-leftofscreen
Nowwearereadytostarttheflow.
RightClickonprojectRunAsMule
Application
OntheConsoleviewbelowserverisgoing
tostart.
Createatxtfileanddragittothe
File_Inputfolder.Itwillbefirstcopiedto
File_Backupfolderandthenmovedto
File_Outputfolder.(theflowwillstartas
wedragthetest_fileintoFile_Input
folder).
OnetheConsolewecanseetheresultof
theLoggercomponentthatwillprintthe
filenamewearetransferring.
Theflowisnowfinished!
Enjoy with Mule!