Define an in-memory JobRepository

With SpringBoot 2.x, the solution is simpler. You have to extend the DefaultBatchConfigurer class like this: @Component public class NoPersistenceBatchConfigurer extends DefaultBatchConfigurer { @Override public void setDataSource(DataSource dataSource) { } } Without datasource, the framework automatically switches to use the MapJobRepository.

Storing in JobExecutionContext from tasklet and accessing in another tasklet

you have at least 4 possibilities: use the ExecutionPromotionListener to pass data to future steps use a (spring) bean to hold inter-step data, e.g. a ConcurrentHashMap without further action this data won’t be accessible for a re-start access the JobExecutionContext in your tasklet, should be used with caution, will cause thread problems for parallel steps … Read more

Spring Batch Framework – Auto create Batch Table

UPDATE: As of spring 2.5.0, you should use spring.batch.jdbc.initialize-schema instead. See source. With Spring Boot 2.0 you probably need this: https://docs.spring.io/spring-boot/docs/2.0.0.M7/reference/htmlsingle/#howto-initialize-a-spring-batch-database spring.batch.initialize-schema=always By default it will only create the tables if you are using an embedded database. Or spring.batch.initialize-schema=never To permanently disable it.

Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded datasource could be configured

Just add : @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class }) works for me. I was getting same error I tried with @EnableAutoConfiguration(exclude=…) didn’t work. For those that are wondering where to add @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class }), as it has been asked by user as well. You need to add it to the main Application class which is under … Read more