title: SFTP @Poller not triggering polling nothing happens
body: <p>I am trying to set the spring boot application which will pool the csv . i do not see any activity happning in the spring boot application nor on filezilla SFTP server but if I change the same code to FTP then it works</p>
  
  <pre><code>
    @Component
      @EnableIntegration
      public class IntegrationConfiguration {
          @Autowired
          FTPConfigProperties ftpConfigProperties;
          @Autowired
          private BeanFactory beanFactory;
          @Value("classpath:certificate.crt")
          Resource certficateFile;
          @Bean
          public SessionFactory&lt;ChannelSftp.LsEntry&gt; ftpSessionFactory() {
              DefaultSftpSessionFactory factory = new DefaultSftpSessionFactory();
              factory.setHost("127.0.0.1");
              factory.setPort(990);
              factory.setUser("abhinav");
              factory.setPassword("nssdw");
  
              factory.setPrivateKey(certficateFile);
              factory.setAllowUnknownKeys(true);
              return new CachingSessionFactory&lt;ChannelSftp.LsEntry&gt;(factory, 100000);
          }
  
          @Bean
          public SftpInboundFileSynchronizer ftpInboundFileSynchronizer() {
              SftpInboundFileSynchronizer fileSynchronizer = new SftpInboundFileSynchronizer(ftpSessionFactory());
              fileSynchronizer.setDeleteRemoteFiles(false);
              fileSynchronizer.setRemoteDirectory("/");
              fileSynchronizer.setFilter(filter());
              fileSynchronizer.setDeleteRemoteFiles(false);
              fileSynchronizer.setPreserveTimestamp(true);
              fileSynchronizer.setBeanFactory(beanFactory);
              return fileSynchronizer;
          }
      //here the poller is configured 
          @Bean
          @InboundChannelAdapter(channel = "fromSftpChannel", poller = @Poller(fixedDelay = "10000"))
          public MessageSource&lt;File&gt; ftpMessageSource() throws Exception {
              SftpInboundFileSynchronizingMessageSource source = new SftpInboundFileSynchronizingMessageSource(
                      ftpInboundFileSynchronizer());
              source.setLocalDirectory(new File("ftp-inbound"));
              source.setAutoCreateLocalDirectory(true);
              source.setMaxFetchSize(1);
              source.setBeanFactory(beanFactory);
              source.setUseWatchService(true);
              return source;
          }
  
          public CompositeFileListFilter&lt;ChannelSftp.LsEntry&gt; filter() {
              CompositeFileListFilter&lt;ChannelSftp.LsEntry&gt; filter = new CompositeFileListFilter&lt;ChannelSftp.LsEntry&gt;();
              filter.addFilter(new SftpSimplePatternFileListFilter("*.csv"));
              filter.addFilter(acceptOnceFilter());
              filter.addFilter(new LastModifiedLsEntryFileListFilter());
              return filter;
          }
  
          @Bean
          public SftpPersistentAcceptOnceFileListFilter acceptOnceFilter() {
              SftpPersistentAcceptOnceFileListFilter filter = new SftpPersistentAcceptOnceFileListFilter(metadataStore(),"ftpPersistentAcceptOnce");
              filter.setFlushOnUpdate(true);
              return filter;
          }
  
  
          @Bean
          public ConcurrentMetadataStore metadataStore() {
              PropertiesPersistingMetadataStore propertiesPersistingMetadataStore = new PropertiesPersistingMetadataStore();
              propertiesPersistingMetadataStore.setBaseDirectory("./metastore");
              propertiesPersistingMetadataStore.setFileName("ftpStream.properties");
              return propertiesPersistingMetadataStore;
          }
  
          @Bean
          @ServiceActivator(inputChannel = "jobChannel", outputChannel = "nullChannel")
          protected JobLaunchingMessageHandler launcher(JobLauncher jobLauncher) {
              return new JobLaunchingMessageHandler(jobLauncher);
          }
      }
  
  </code></pre>
  
  <p>here the next call where I trigger the spring batch then it goes to service actuator </p>
  
  <pre><code>@Component
  public class FileToJobTransformer implements ApplicationContextAware {
      private ApplicationContext context;
     @Autowired
      private Job job;
  
  
  
      @Transformer(inputChannel = "fromSftpChannel", outputChannel = "jobChannel")
      public JobLaunchRequest transform(File aFile) throws Exception {
          String fileName = aFile.getName();
          JobParameters jobParameters = new JobParametersBuilder().addString(
                  "input.file", aFile.getAbsolutePath()).toJobParameters();
          JobLaunchRequest request = new JobLaunchRequest(job, jobParameters);
          return request;
      }
  
      @Override
      public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
          this.context = applicationContext;
      }
  }
  </code></pre>
  
  <p>the custome code is as follow </p>
  
  <pre><code>
  public class LastModifiedLsEntryFileListFilter implements FileListFilter&lt;ChannelSftp.LsEntry&gt; {
  
      private static final long DEFAULT_AGE = 60;
  
      private volatile long age = DEFAULT_AGE;
  
      public long getAge() {
          return this.age;
      }
  
      public void setAge(long age) {
          setAge(age, TimeUnit.SECONDS);
      }
  
      public void setAge(long age, TimeUnit unit) {
          this.age = unit.toSeconds(age);
      }
  
      @Override
      public List&lt;ChannelSftp.LsEntry&gt; filterFiles(ChannelSftp.LsEntry[] files) {
  
          System.out.println("files = [" + files.length + "]");
  
          List&lt;ChannelSftp.LsEntry&gt; list = new ArrayList&lt;ChannelSftp.LsEntry&gt;();
  
          long now = System.currentTimeMillis() / 1000;
  
          for (ChannelSftp.LsEntry file : files) {
              if (file.getAttrs()
                      .isDir()) {
                  continue;
              }
              int lastModifiedTime = file.getAttrs()
                      .getMTime();
  
              if (lastModifiedTime + this.age &lt;= now) {
                  list.add(file);
              }
          }
  
          Collections.reverse(list);
        ArrayList&lt;ChannelSftp.LsEntry&gt; oneElementList = new  ArrayList&lt;ChannelSftp.LsEntry&gt;(1) ;
        oneElementList.add(list.get(0));
          return oneElementList;
      }
  
  }
  
  
  </code></pre>