title: how to trigger spring batch from spring integration java dsl Integration file poller integrationflows
body: <p>How to trigger a spring batch job from a spring integration, using java dsl Integrationflows. </p>
  
  <p>I have the below code which polls for a file in a directory , the moment a new file is added to the directory , a message is generated , i want to trigger a spring batch job at that instance. Please advice.</p>
  
  <pre><code>@Bean
  public IntegrationFlow inboundFileIntegration(@Value("${inbound.file.poller.fixed.delay}") long period,
                                                @Value("${inbound.file.poller.max.messages.per.poll}") int maxMessagesPerPoll,
                                                TaskExecutor taskExecutor,
                                                MessageSource&lt;File&gt; fileReadingMessageSource) {
  
      return IntegrationFlows.from(fileReadingMessageSource,
              c -&gt; c.poller(Pollers.fixedDelay(period)
                      .taskExecutor(taskExecutor)
                      .maxMessagesPerPoll(maxMessagesPerPoll)))
                .transform(Transformers.fileToString())
                       .channel(ApplicationConfiguration.INBOUND_CHANNEL)                 
  
               .get();
  }
  </code></pre>