title: How to stop OR change delay of Spring Integration Poller
body: <p>I am using Spring Integration to read files from a directory using following configuration. However I am looking to stop poller once I found any file until service not restarted again. Is there any way I can change poller delay at runtime OR start/stop Poller at runtime? </p>
  
  <pre><code>@Bean
  public MessageChannel fileInputChannel() {
      return new DirectChannel();
  }
  
  @Bean
  @InboundChannelAdapter(channel = "fileInputChannel", poller = @Poller(cron = "0 0/10 19-23,0-6 ? * *", maxMessagesPerPoll = "1"))
  public MessageSource&lt;File&gt; fileReadingMessageSource() {
      FileReadingMessageSource source = new FileReadingMessageSource();
      File directory = new File(localFtpDirectory);
      if (clearLocalDir &amp;&amp; directory.isDirectory() &amp;&amp; directory.exists()) {
          LOG.info("Clear directory {} on startup of service", directory);
          Arrays.stream(directory.listFiles()).forEach(File::delete);
      }
      source.setDirectory(directory);
      source.setFilter(new LastModifiedFileFilter(remoteFileFilter));
      return source;
  }
  
  @Bean
  @ServiceActivator(inputChannel = "fileInputChannel")
  public MessageHandler fileHandler() {
      return new MessageHandlerService();
  }
  </code></pre>