title: Spring Integration file processing send it to http
body: <p>I have some points to resolve it in spring integration, I'm kind of newbie in spring integration.</p>
  
  <p>The scenario is to process three dbf files and extract the data and send it to HTTP rest service as JSON  if there is no response from that service during 3 mins should wait 10 mins and attempt again. The rest service will reply with json. </p>
  
  <p>now I have three to four things I can't solve it: </p>
  
  <ol>
  <li>I need to read the reply from rest service and depend on that reply decide either to retry or to finish the process. (beside if I send message to rest and no response should also retry)</li>
  <li>I need to get multiple files from dynamic folder names for example ({wherever}/20140101/HERE WILL FIND THE THREE DBF FILES). there is any possibility to make folder name as pattern or as date with certain format? and the file adapter can process many files or files by file.</li>
  <li>there is any possibility to process dbf files through spring integration and transform it to json </li>
  </ol>
  
  <p>below my spring integration configuration:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
      http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
      http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file.xsd
      http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd
      http://www.springframework.org/schema/integration/http http://www.springframework.org/schema/integration/http/spring-integration-http.xsd"
  xmlns:int="http://www.springframework.org/schema/integration"
  xmlns:int-file="http://www.springframework.org/schema/integration/file"
  xmlns:int-http="http://www.springframework.org/schema/integration/http"
  xmlns:task="http://www.springframework.org/schema/task"&gt;
  
  
  &lt;int:service-activator input-channel="filesInChannelDBF"
      output-channel="requestChannel" &gt;
      &lt;bean class="com.mm.integration.serviceactivator.FileProcessor" /&gt;
  &lt;/int:service-activator&gt;
  
  
  &lt;int:channel id="requestChannel" /&gt;
  
  
  
  &lt;int-http:outbound-gateway request-channel="requestChannel"
      url="http://localhost:8090/receiveGateway" http-method="POST" /&gt;
  
  &lt;int-file:inbound-channel-adapter id="filesInChannelDBF"
      directory="file:input" filename-pattern="FILENAME*"&gt;
      &lt;int:poller id="poller" fixed-rate="100" task-executor="executor" /&gt;
  
  &lt;/int-file:inbound-channel-adapter&gt;
  
  &lt;task:executor id="executor" pool-size="10" /&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>and here my pom:</p>
  
  <pre><code>    &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-  4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.mm.integration&lt;/groupId&gt;
    &lt;artifactId&gt;XXXX&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;parent&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
        &lt;version&gt;1.1.9.RELEASE&lt;/version&gt;
     &lt;/parent&gt;
     &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-integration&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-logging&lt;/artifactId&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
             &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>and here my spring entry point.</p>
  
  <pre><code>@RestController
  @EnableAutoConfiguration
  @EnableIntegration
  @ImportResource("classpath:spring/config/concurrentFileProcessing-config.xml")
  public class MainApp {
  
      @RequestMapping(value="/receiveGateway" , method=RequestMethod.POST)
      public String testGateway(String jSon){
  
          System.out.println("Starting process the message [reciveing]");
  
          return "{HelloMessage: \"Hello\"}";
      }
  
  
      public static void main(String[] args) throws Exception {
          SpringApplication.run(MainApp.class, args);
      }
  
  }
  </code></pre>