title: Use of multiple DataSources in Spring Batch
body: <p>I am trying to configure a couple of datasources within Spring Batch. On startup, Spring Batch is throwing the following exception:  </p>
  
  <p><code>To use the default BatchConfigurer the context must contain no more thanone DataSource, found 2</code>  </p>
  
  <p>Snippet from Batch Configuration
  </p>
  
  <pre class="lang-java prettyprint-override"><code>@Configuration
  @EnableBatchProcessing 
  public class BatchJobConfiguration {
  
      @Primary
      @Bean(name = "baseDatasource")
      public DataSource dataSource() {
           // first datasource definition here
      }
      @Bean(name = "secondaryDataSource")
      public DataSource dataSource2() {
           // second datasource definition here
      }
      ...
  }
  </code></pre>
  
  <p>Not sure why I am seeing this exception, because I have seen some xml based configuration for Spring batch that declare multiple datasources. I am using Spring Batch core version 3.0.1.RELEASE with Spring Boot version 1.1.5.RELEASE. Any help would be greatly appreciated.</p>