Write a coding to help configure an FTP handler into the Mule ESB

devquora
devquora

Posted On: Feb 22, 2018

 

The following code can be used to configure an FTP handler into the Mule ESB ftp_handler-config.xml

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

<!DOCTYPE mule-configuration PUBLIC "-//MuleSource //DTD mule-configuration XML V1.0//EN"
                                "http://mule.mulesource.org/dtds/mule-configuration.dtd">
<mule-configuration id="ftp_handler"version="1.0">
  <description>
   Ftp get to a remote server and place into a local directory on the MULE server
  </description>
   <!--
  An interceptor is a piece of code that can be configured to execute
   before and/or after an event is received fora component.
   You can define a stack of interceptors that will be executed in sequence.
   You can then configure the stack on your components.
  -->
 <interceptor-stack name="default">
     <interceptor className="org.mule.interceptors.LoggingInterceptor"/>
     <interceptor className="org.mule.interceptors.TimerInterceptor"/>
 </interceptor-stack>
 <!--
    The Mule model initializes and manages your UMO components
 -->
 <model name="Retrieve_File">
     <!--
         A Mule descriptor defines all the necessary information about how your components will interact with the framework, other components in the system and external sources. Please refer to the Configuration Guide fora full description of all the parameters.
    -->
  <mule-descriptor name="ftpInbound"
      implementation="org.mule.components.simple.BridgeComponent">
      <inbound-router>
          <endpoint address="ftp://mule:mule@localhost/ftp">
     <filter pattern="*.txt"
     className="org.mule.providers.file.filters.FilenameWildcardFilter"/>
     <properties>
         <property name="binary"value="false"/>
         <property name="pollingFrequency"value="1000"/>
         <property name="filename"value="document.txt"/>
         <property name="outputPattern"value="FtpFile-${DATE}.done"/>
     </properties>
 </endpoint>
  </inbound-router>
  <outbound-router>
      <router className="org.mule.routing.outbound.OutboundPassThroughRouter">
          <endpoint address="file:///C:/MULE/inbound"/>
      </router>
   </outbound-router>
   <!--
      Here we tell this component to use the interceptor stack defined above
   -->
   <interceptor name="default"/>
  </mule-descriptor>
  </model>
</mule-configuration>

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    ESB interview questions

    What do you understand by Mule?

    Mule ESB (also known as Mule) is a lightweight Java-based Enterprise Service Bus (ESB) and an incorporation..

    ESB interview questions

    What do you understand by ESB?

    An Enterprise Service Bus (ESB) is a programming language for engineering especially for middleware..

    ESB interview questions

    List the different primitives that are constantly used in Mediation.

    Some of the commonly used primitives in Mediation include the following:..