Skip to content

Sftp polling until remote file available #3849

Answered by oxcafedead
af6140 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @af6140
Please take a look at https://docs.spring.io/spring-integration/reference/html/sftp.html#configuring-with-java-configuration

Specifically this bean definition:

    @Bean
    @InboundChannelAdapter(channel = "sftpChannel", poller = @Poller(fixedDelay = "5000"))
    public MessageSource<File> sftpMessageSource() {
        SftpInboundFileSynchronizingMessageSource source =
                new SftpInboundFileSynchronizingMessageSource(sftpInboundFileSynchronizer());
        source.setLocalDirectory(new File("sftp-inbound"));
        source.setAutoCreateLocalDirectory(true);
        source.setLocalFilter(new AcceptOnceFileListFilter<File>());
        source.setMaxFetchSize(1);
        

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@artembilan
Comment options

@artembilan
Comment options

Answer selected by artembilan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #3848 on July 15, 2022 15:52.