Details
-
Type:
New Feature
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.3.3
-
Fix Version/s: None
-
Component/s: Core: Transports
-
Labels:None
-
Similar Issues:None
Description
In my experience I have already done a lot of integration using FTP. Typically source or destination applications reside on some ancient AS/400 system only capable of writing or reading files. FTP is also used in a lot of B2B scenario's.
Since the process that will be reading the files we've sent to the FTP site typically does not know anything about file locking, we need to write the file with a .tmp (or whatever) extension first, and afterwards rename it to the correct filename.
If we don't use the above scenario, we might have a problem if the process on the FTP site starts reading the file, while we're still "Streaming" it.
Attached you can find working code that creates temp files first and then renames it. Configure it like this:
<connector name="myFTPConnector"
className="org.foo.mule.providers.ftp.FtpConnector">
<properties>
<map name="serviceOverrides">
<property name="dispatcher.factory" value="org.foo.mule.providers.ftp.FtpMessageDispatcherFactory"/>
</map>
<property name="outputPattern" value="${UUID}.xml"/>
<property name="tempOutputPattern" value="${UUID}.tmp"/>
</properties>
</connector>
I have taken the code from 1.3.3 as a base. Hope it's not too much work to merge it with the mainstream code.