Q: Spring-integration-ftp streaming files from ftp delete files from server I am working on a Spring Boot App to read files from a FTP server and write the data into database. I am using Spring Integration FTP with streaming (FtpStreamingMessageSource)
@Bean
@InboundChannelAdapter(channel = "streamPHI", poller = @Poller(fixedDelay = "2000", maxMessagesPerPoll="-1"))
public MessageSource<InputStream> ftpMessageSourcePHI() {
    FtpStreamingMessageSource messageSource = new FtpStreamingMessageSource(templatePhi, null);
    messageSource.setRemoteDirectory(remoteDirectory);
    messageSource.setFilter(new FtpPersistentAcceptOnceFileListFilter(new SimpleMetadataStore(), "streaming"));
    return messageSource;
}

This is turn stream this into another channel
@Bean
@Transformer(inputChannel = "streamPHI", outputChannel = "data")
public org.springframework.integration.transformer.Transformer transformerPhi() {
    return new StreamTransformer();
}

When the polling starts, it successfully gets the files, but also DELETES the files from remote FTP server. which is not required. Can anyone suggest what might be the cause ?
Thanks
---- Update
But in my case, I have not written anything to delete the file. After the first "Transformation" I have used another transformation that will just get me the content of the file from byte to string. And, then a service activator to parse and save it into database. 
@Bean
@Transformer(inputChannel = "data", outputChannel = "parse-shipping")
public org.springframework.integration.transformer.Transformer handler() {
    return new ByteToStringTransformer();

}

@ServiceActivator(inputChannel = "parse-shipping")
public void parseShippingInformation(String shipFileContent){
...
}


@Component
public class ByteToStringTransformer extends AbstractTransformer {

@Override
protected Object doTransform(Message<?> message) throws Exception {
    byte[] x = (byte[]) message.getPayload();
    StringBuilder str = new StringBuilder();
    for (byte b : x) {
        str.append((char) b);
    }
    str.append(message.getHeaders().get("file_remoteFile"));
    return str.toString();
}

}
Is there anything on FTP Settings that might be causing this? (Same time I am also looking into this but any hints will be helpful)

A: There is nothing in the adapter that will delete the file; in fact the documentation mentions that...

Unlike the non-streaming inbound channel adapter, this adapter does not prevent duplicates by default. If you do not delete the remote file (e.g. using an outbound gateway with an rm command) and you wish to prevent the file being processed again, you can configure an FtpPersistentFileListFilter in the filter attribute. If you don't actually want to persist the state, an in-memory SimpleMetadataStore can be used with the filter. If you wish to use a filename pattern (or regex) as well, use a CompositeFileListFilter.

Something else must be deleting your file.
