File component in mule
-
Upload
rajkattamuri -
Category
Technology
-
view
149 -
download
0
Transcript of File component in mule
![Page 1: File component in mule](https://reader036.fdocuments.in/reader036/viewer/2022083105/5877f7251a28ab91178b4e45/html5/thumbnails/1.jpg)
File Component In Mule Demo
![Page 2: File component in mule](https://reader036.fdocuments.in/reader036/viewer/2022083105/5877f7251a28ab91178b4e45/html5/thumbnails/2.jpg)
Abstract
• The main motto of this PPT is how to use File component in our applications.
![Page 3: File component in mule](https://reader036.fdocuments.in/reader036/viewer/2022083105/5877f7251a28ab91178b4e45/html5/thumbnails/3.jpg)
Introduction
• The File connector allows your Mule application to exchange files with a file system. You can implement the File connector as an inbound endpoint (such as, a message source), or as an outbound endpoint. This endpoint implements a one-way exchange pattern only.
![Page 4: File component in mule](https://reader036.fdocuments.in/reader036/viewer/2022083105/5877f7251a28ab91178b4e45/html5/thumbnails/4.jpg)
Example
![Page 5: File component in mule](https://reader036.fdocuments.in/reader036/viewer/2022083105/5877f7251a28ab91178b4e45/html5/thumbnails/5.jpg)
• .mflow• <?xml version="1.0" encoding="UTF-8"?>
• <mule xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
• http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
• http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd">
• <flow name="FileFlow1" doc:name="FileFlow1">• <file:inbound-endpoint path=“Source file location" moveToDirectory=“Destination file location"
responseTimeout="10000" doc:name="File"/>• <logger message="--file is successfully picked" level="INFO" doc:name="Logger"/>• </flow>• </mule>
![Page 6: File component in mule](https://reader036.fdocuments.in/reader036/viewer/2022083105/5877f7251a28ab91178b4e45/html5/thumbnails/6.jpg)
• Output:• INFO 2015-09-15 12:32:25,959 [main] org.mule.module.management.agent.JmxAgent: Registered
Connector Service with name Mule.File:type=Connector,name="connector.file.mule.default.1"• INFO 2015-09-15 12:32:25,962 [main] org.mule.DefaultMuleContext: • **********************************************************************• * Application: File *• * OS encoding: Cp1252, Mule encoding: UTF-8 *• * *• * Agents Running: *• * Clustering Agent *• * JMX Agent *• **********************************************************************• INFO 2015-09-15 12:32:25,963 [main] org.mule.module.launcher.MuleDeploymentService: • ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++• + Started app 'File' +• ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++• INFO 2015-09-15 12:32:26,931 [[File].connector.file.mule.default.receiver.01]
org.mule.transport.file.FileMessageReceiver: Lock obtained on file: Source file location\filename.xml• INFO 2015-09-15 12:32:26,990 [[File].FileFlow1.stage1.02]
org.mule.api.processor.LoggerMessageProcessor: --file is successfully picked
![Page 7: File component in mule](https://reader036.fdocuments.in/reader036/viewer/2022083105/5877f7251a28ab91178b4e45/html5/thumbnails/7.jpg)
• Flow of execution:1. Service will pole the file for every 1sec”2. It will pick the file from source folder and will
move to destination location3. Service will display a message called “file is
successfully picked”
![Page 8: File component in mule](https://reader036.fdocuments.in/reader036/viewer/2022083105/5877f7251a28ab91178b4e45/html5/thumbnails/8.jpg)
References
• https://docs.mulesoft.com/mule-user-guide/v/3.7/file-connector