Search code examples
filehttpmuleesbconnector

Files not move to directory Mule ESB with HTTP Connector


I'm trying to send files as is from one endpoint to another (in example below one endpoint with two flows).

Files successfully going out, but not moving to backup directory. In this case they are going out again after timeout. And again and again. What is wrong? The same configuration with FTP connector works best.

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" 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="CE-3.5.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/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd">
    <flow name="temptestFlow1" doc:name="temptestFlow1">
        <file:inbound-endpoint path="/Data/Input" moveToDirectory="/Data/Backup" responseTimeout="10000" doc:name="File"/>
        <logger level="INFO" doc:name="Logger"/>
        <http:outbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" method="POST" doc:name="HTTP"/>
    </flow>
    <flow name="temptestFlow2" doc:name="temptestFlow2">
        <http:inbound-endpoint exchange-pattern="one-way" host="localhost" port="8081" doc:name="HTTP"/>
        <file:outbound-endpoint path="/Data/Output" responseTimeout="10000" doc:name="File"/>
    </flow>
</mule>

Solution

  • Try adding the File Connector configuration to your mule config.

     <file:connector name="myFileConnector" autoDelete="true" streaming="false" validateConnections="true"></file:connector>   
    

    Hope this helps.