MuleESB
My first http flow: using File to string 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’
,‘FileToString’,‘Logger’and selectthe
firstone.
DragandDropHTTPthenJava
component intoMessageFlowview.
Nowwehavetoconfigure theFile
componentforourHTTPflow.
Doubleclickonitandsetapathinalocal
folderthencreateatxtfileoutsidethe
folder.
ClickOKandSAVE
ConfiguretheLoggercomponenttoprint
outtheflowmessageaboutthefilewe
aretransferring(showonConsole).
File-To-Stringelementconfiguresa
transformerthatreadsthecontentof
java.io.Fileintoajava.lang.String.
Actuallywedon’thavetogiveitacustom
configuration.
ClickonSAVEattop-leftofscreen
NowwecanstartourMuleserver
RightClickonprojectRunAsMule
Application
OntheConsoleviewbelowserverisgoing
tostart.
Attheendyouwillseethestatus
DEPLOYED.
Thismeansthatserverisupandrunning
Nowwecanseetheresult:
dropthetxtfilewecreatedintothefolder
andlookattheconsolemessage.
Theflowworks!
Enjoy with Mule!