title: Spring integration poller XML configuration with spring boot
body: <p>I am working on a project in spring boot and I need to add Spring integration poller for polling files from a location and run spring batch on that file to process it.</p>
  
  <p>I have used spring batch integration for this(Document Reference below.)</p>
  
  <p><a href="http://docs.spring.io/spring-batch/trunk/reference/html/springBatchIntegration.html" rel="nofollow noreferrer">http://docs.spring.io/spring-batch/trunk/reference/html/springBatchIntegration.html</a></p>
  
  <p>In spring boot, I have succesfully configured my poller in @Configuration file as below</p>
  
  <pre><code>@Bean
  @InboundChannelAdapter(value = "fileInputChannel", poller = @Poller(
    fixedRate = "1000"), autoStartup = "true")
  public MessageSource&lt;File&gt; filesScanner() {
    CompositeFileListFilter&lt;File&gt; filters = new   CompositeFileListFilter&lt;File&gt;();
    filters.addFilter(new   SimplePatternFileListFilter("*.xml"));
    filters.addFilter(new AcceptOnceFileListFilter&lt;File&gt;());
    filters.addFilter(getLastModifiedFileFilter());
    FileReadingMessageSource source = new FileReadingMessageSource();
    source.setDirectory(new File("F:/DataInput/"));
    source.setFilter(filters);
    return source;
  }
  </code></pre>
  
  <p>This poller is defined in java configuration whereas the channels are defined in xml as below.</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"
    xmlns:int="http://www.springframework.org/schema/integration"
    xmlns:int-file="http://www.springframework.org/schema/integration/file"
    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"&gt;
      &lt;int:channel id="ticketingResponse" /&gt;
      &lt;int:channel id="mailFailureTicketData" /&gt;
      &lt;int:channel id="moveSuccessTicketingFile" /&gt;
      &lt;int:channel id="moveFailureTicketingFile" /&gt;
      &lt;int:channel id="ticketingFileInput" /&gt;
      &lt;int:channel id="ticketingJobParameters" /&gt;
      &lt;!-- &lt;int-file:inbound-channel-adapter id="filePoller"
      channel="inboundFileChannel"
      directory="file:/tmp/myfiles/"
      filename-pattern="*.csv"&gt;
    &lt;int:poller fixed-rate="1000"/&gt;
  &lt;/int-file:inbound-channel-adapter&gt; --&gt;
      &lt;bean id="earliestTicketingFileSelecter" class="com.avios.integration.iqcx.FilesSortingComparator" /&gt;
      &lt;bean id="compositeFilesFilter"
          class="org.springframework.integration.file.filters.CompositeFileListFilter"&gt;
          &lt;constructor-arg&gt;
              &lt;list&gt;
                  &lt;bean
                      class="org.springframework.integration.file.filters.RegexPatternFileListFilter"&gt;
                      &lt;constructor-arg name="pattern" value="${ticketing.input.file.pattern}" /&gt;
                  &lt;/bean&gt;
                  &lt;bean class="org.springframework.integration.file.filters." /&gt;
                  &lt;bean
                      class="org.springframework.integration.file.filters.LastModifiedFileListFilter"&gt;
                      &lt;property name="age" value="${ticketing.input.file.age}" /&gt;
                  &lt;/bean&gt;
              &lt;/list&gt;
          &lt;/constructor-arg&gt;
      &lt;/bean&gt;
      &lt;bean id="ticketingFilesScanner"
      class="org.springframework.integration.file.FileReadingMessageSource"&gt;
      &lt;property name="filter" value="compositeFilesFilter" /&gt;
      &lt;property name="directory" value="/tmp/myfiles/" /&gt;
  &lt;/bean&gt;
  &lt;int-file:inbound-channel-adapter id="filePoller"
      channel="inboundFileChannel"
      directory="file:/tmp/myfiles/"
      filename-pattern="*.csv"&gt;
    &lt;int:poller fixed-rate="1000"/&gt;
  &lt;/int-file:inbound-channel-adapter&gt;&lt;!-- &lt;int-file:inbound-channel-adapter
          directory="${ticketing.input.file.path}" channel="ticketingFileInput"
          comparator="earliestTicketingFileSelecter" auto-startup="true" filter="compositeFilesFilter" &gt;
          &lt;int:poller &gt;&lt;/int:poller&gt;
          &lt;/int-file:inbound-channel-adapter&gt; --&gt;
      &lt;int:transformer id="iqcxFilesToJobParameters" ref="jobParameterTransformer"
          input-channel="ticketingFileInput" method="addTicketingFileToJobParameter"
          output-channel="ticketingJobParameters"  /&gt;
      &lt;int:outbound-channel-adapter channel="ticketingJobParameters"
          ref="iqcxJobLaunchingGateway" method="handleMessage" /&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>I am getting the below error in my XML configuration file.</p>
  
  <p><strong>cvc-complex-type.3.2.2: Attribute 'fixed-rate' is not allowed to appear in element 'int:poller'.</strong></p>
  
  <p>I checked this on google and found only the below link which wasn't much of use as i am getting exact same error.</p>
  
  <p><a href="https://stackoverflow.com/questions/33403056/using-spring-boot-spring-integration-with-database-backed-configuration">Using Spring Boot &amp; Spring Integration with database backed Configuration</a></p>
  
  <p><a href="https://stackoverflow.com/questions/28625635/attribute-fixed-rate-is-not-allowed-to-appear-in-element-intpoller">Attribute &#39;fixed-rate&#39; is not allowed to appear in element &#39;int:poller&#39;</a></p>
  
  <p>Spring boot version i am using is as below.</p>
  
  <pre><code>    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
      &lt;version&gt;1.3.6.RELEASE&lt;/version&gt;
  </code></pre>
  
  <p>Spring integration jar in library - <strong>Spring-integration-core-4.2.8.RELEASE.jar</strong></p>
  
  <p>I also tried excluding integration jar from batch-integration dependency and adding it separately as below but that didn't work either.</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.batch&lt;/groupId&gt;
          &lt;artifactId&gt;spring-batch-integration&lt;/artifactId&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;org.springframework.integration&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-integration-core&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;
      &lt;!-- https://mvnrepository.com/artifact/org.springframework.integration/spring-integration-core --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.integration&lt;/groupId&gt;
          &lt;artifactId&gt;spring-integration-core&lt;/artifactId&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p>Also checked the XSD <a href="http://www.springframework.org/schema/integration/spring-integration.xsd" rel="nofollow noreferrer">http://www.springframework.org/schema/integration/spring-integration.xsd</a> and it has the attribute fixed-delay in poller. Any suggestions for resolving this?</p>