I was able to know whats going on, I am using custom reader/processor/writer. When springboot application starts it actually try to do dependency injection of this custom beans beans where I have written some application logic.

Example

** TestConfiguration.class**

    @Configuration
    @EnableBatchProcessing
    public class TestConfiguration {

        @Bean
        @Conditional(Employee.class)
        public ItemWriter<Employee> writer_employee(DataSource dataSource) throws IOException {
            FlatFileItemWriter<Employee> writer = new FlatFileItemWriter<Employee>();
            writer.setResource(new FileSystemResource(FinanceReportUtil.createFile("Employee.csv")));
            writer.setHeaderCallback(new FlatFileHeaderCallback() {
                @Override
                    public void writeHeader(Writer writer) throws IOException {
                    writer.write("id, name");
                 }
             });
            DelimitedLineAggregator<Employee> delLineAgg = new DelimitedLineAggregator<Employee>();
            delLineAgg.setDelimiter(",");
            BeanWrapperFieldExtractor<Employee> fieldExtractor = new BeanWrapperFieldExtractor<Employee>();
            fieldExtractor.setNames(new String[]{"id", "name"});
            delLineAgg.setFieldExtractor(fieldExtractor);
            writer.setLineAggregator(delLineAgg);
            return writer;
        }

        @Bean
        @Conditional(Manager.class)
        public ItemWriter<Person> writer_manager(DataSource dataSource) throws IOException {

            // Does the same logic as employee
        }

        // Also has job and step etc.
    }

It will create the file even with spring.batch.job.enabled=false, to overcome this I have created custom logic to inject the beans or not as below

application.properties

# all, manager, employee
person=manager

ManagerCondition.class

public class ManagerCondition implements Condition {

@Override
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
    String person= context.getEnvironment().getProperty("person");
    return person.equals("manager");

}
Answer from Anuj Acharya on Stack Overflow
🌐
Spring
docs.spring.io › spring-boot › reference › io › spring-batch.html
Spring Batch :: Spring Boot
This will cause the auto-configuration to back off, including initialization of Spring Batch’s database schema (JDBC or MongoDB). Spring Batch can then be configured using the @Enable*JobRepository annotation’s attributes rather than the previously described configuration properties.
Top answer
1 of 3
2

I was able to know whats going on, I am using custom reader/processor/writer. When springboot application starts it actually try to do dependency injection of this custom beans beans where I have written some application logic.

Example

** TestConfiguration.class**

    @Configuration
    @EnableBatchProcessing
    public class TestConfiguration {

        @Bean
        @Conditional(Employee.class)
        public ItemWriter<Employee> writer_employee(DataSource dataSource) throws IOException {
            FlatFileItemWriter<Employee> writer = new FlatFileItemWriter<Employee>();
            writer.setResource(new FileSystemResource(FinanceReportUtil.createFile("Employee.csv")));
            writer.setHeaderCallback(new FlatFileHeaderCallback() {
                @Override
                    public void writeHeader(Writer writer) throws IOException {
                    writer.write("id, name");
                 }
             });
            DelimitedLineAggregator<Employee> delLineAgg = new DelimitedLineAggregator<Employee>();
            delLineAgg.setDelimiter(",");
            BeanWrapperFieldExtractor<Employee> fieldExtractor = new BeanWrapperFieldExtractor<Employee>();
            fieldExtractor.setNames(new String[]{"id", "name"});
            delLineAgg.setFieldExtractor(fieldExtractor);
            writer.setLineAggregator(delLineAgg);
            return writer;
        }

        @Bean
        @Conditional(Manager.class)
        public ItemWriter<Person> writer_manager(DataSource dataSource) throws IOException {

            // Does the same logic as employee
        }

        // Also has job and step etc.
    }

It will create the file even with spring.batch.job.enabled=false, to overcome this I have created custom logic to inject the beans or not as below

application.properties

# all, manager, employee
person=manager

ManagerCondition.class

public class ManagerCondition implements Condition {

@Override
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
    String person= context.getEnvironment().getProperty("person");
    return person.equals("manager");

}
2 of 3
1

I also faced the same issue, the property 'spring.batch.job.enabled=false' was not recognising at start up when we give this in properties file. It could be because the properties might not have loaded into context before the batch initiated.

So i have set the property 'spring.batch.job.enabled=false' in standalone.xml as a system property like below.

<system-properties>  
        <property name="spring.batch.job.enabled" value="false"/>  
</system-properties>  

With this it SUCCESSFULLY worked & the spring batch jobs did not initialised on server start up.

Please note that the system-properties must be placed right after the extensions tag in standalone.xml.

People also ask

What is a "Job Repository" in Spring Batch?
“JobRepository” is the mechanism in Spring Batch that makes all this persistence possible. It provides CRUD operations for JobLauncher, Job, and Step instantiations.
🌐
toptal.com
toptal.com › developers › spring › spring-batch-tutorial
Spring Batch Tutorial: Batch Processing Made Easy with Spring | ...
What is Spring Batch?
Spring Batch is a lightweight, comprehensive framework designed to facilitate development of robust batch applications. It also provides more advanced technical services and features that support extremely high volume and high performance batch jobs through its optimization and partitioning techniques.
🌐
toptal.com
toptal.com › developers › spring › spring-batch-tutorial
Spring Batch Tutorial: Batch Processing Made Easy with Spring | ...
What is the relationship between a "Job" and a "Step" in Spring Batch?
A “Step” is an independent, specific phase of a batchJob”, such that every Job is composed of one or more Steps.
🌐
toptal.com
toptal.com › developers › spring › spring-batch-tutorial
Spring Batch Tutorial: Batch Processing Made Easy with Spring | ...
🌐
Spring
spring.io › projects › spring-batch
Spring Batch
It also provides more advanced technical services and features that will enable extremely high-volume and high performance batch jobs through optimization and partitioning techniques.
🌐
GeeksforGeeks
geeksforgeeks.org › advance java › spring-boot-with-spring-batch
Spring Boot with Spring Batch - GeeksforGeeks
October 27, 2025 - JobExecution: Tracks job runs, including status and timestamps. StepExecution: Records details of each step execution. This allows restartability (resume from failure point) and monitoring of batch executions. A relational database (e.g., MySQL, HSQLDB) typically stores this metadata. Spring Batch ensures transactional integrity — if a step fails, its changes can be rolled back.
🌐
Mani's blog
manib.hashnode.dev › spring-batch-with-spring-boot-3
Spring Batch with Spring Boot 3.0
April 21, 2025 - Now, Enable batch processing in BatchApplication. @EnableBatchProcessing annotation enables Spring Batch features and provides a base configuration for setting up batch jobs.
Find elsewhere
🌐
Toptal
toptal.com › developers › spring › spring-batch-tutorial
Spring Batch Tutorial: Batch Processing Made Easy with Spring | Toptal®
January 16, 2026 - The @EnableBatchProcessing annotation enables Spring Batch features and provides a base configuration for setting up batch jobs.
🌐
OneUptime
oneuptime.com › home › blog › how to configure spring batch job scheduling
How to Configure Spring Batch Job Scheduling
February 1, 2026 - The simplest way to schedule batch jobs is using Spring's built-in @Scheduled annotation. This works well for straightforward scheduling needs within a single application instance.
🌐
Spring
docs.spring.io › spring-cloud-task › reference › batch.html
Batch :: Spring Cloud Task
As discussed earlier, Spring Cloud Task applications support the ability to record the exit code of a task execution. However, in cases where you run a Spring Batch Job within a task, regardless of how the Batch Job Execution completes, the result of the task is always zero when using the default Batch/Boot behavior.
🌐
Medium
medium.com › @AlexanderObregon › streamlining-batch-processing-and-task-scheduling-with-spring-batch-bc407c93196f
Streamlining Batch Processing and Task Scheduling with Spring Batch
April 19, 2024 - Create a Java configuration class that defines the Spring Batch job, including the reader, processor, and writer components. @Configuration @EnableBatchProcessing public class BatchConfiguration { @Autowired private JobBuilderFactory jobBuilderFactory; @Autowired private StepBuilderFactory stepBuilderFactory; // Define reader, processor, and writer beans here @Bean public Job myBatchJob() { return jobBuilderFactory.get("myBatchJob") .start(myBatchStep()) .build(); } @Bean public Step myBatchStep() { return stepBuilderFactory.get("myBatchStep") .<InputType, OutputType>chunk(10) // Chunk size .reader(myReader()) .processor(myProcessor()) .writer(myWriter()) .build(); } }
🌐
Spring
docs.spring.io › spring-batch › docs › 3.0.x › reference › html › configureJob.html
4. Configuring and Running a Job
The core interface for this configuration is the BatchConfigurer. The default implementation provides the beans mentioned above and requires a DataSource as a bean within the context to be provided. This data source will be used by the JobRepository. With the base configuration in place, a user can use the provided builder factories to configure a job. Below is an example of a two step job configured via the JobBuilderFactory and the StepBuilderFactory. @Configuration @EnableBatchProcessing @Import(DataSourceConfiguration.class) public class AppConfig { @Autowired private JobBuilderFactory job
🌐
GeeksforGeeks
geeksforgeeks.org › springboot › configuring-multiple-spring-batch-jobs-in-a-spring-boot-application
Configuring Multiple Spring Batch Jobs in a Spring Boot Application - GeeksforGeeks
July 23, 2025 - For Gradle Project: implementation 'org.springframework.boot:spring-boot-starter-batch' ... Create a configuration class for each job.
🌐
Baeldung
baeldung.com › home › spring › introduction to spring batch
Introduction to Spring Batch | Baeldung
December 24, 2024 - Learn how to create Spring Batch jobs with conditional flow.
🌐
Docs4dev
docs4dev.com › docs › en › spring-batch › 4.1.x › reference › job.html
Spring Batch Reference
Spring 3 brought the ability to configure applications via java in addition to XML. As of Spring Batch 2.2.0, batch jobs can be configured using the same java config. There are two components for the java based configuration: the @EnableBatchProcessing annotation and two builders.
🌐
Baeldung
baeldung.com › home › spring › spring boot › spring boot with spring batch
Spring Boot With Spring Batch | Baeldung
January 8, 2024 - Now we’ll move on to the key component, our job configuration. We’ll go step by step, building up our configuration, and explaining each part along the way: @Configuration public class BatchConfiguration { @Value("${file.input}") private String fileInput; // ... } First, we’ll start with a standard Spring @Configuration class. Note that with Spring boot 3.0, the @EnableBatchProcessing is discouraged.
🌐
Spring
docs.spring.io › spring-batch › reference › step › controlling-flow.html
Controlling Step Flow :: Spring Batch Reference
It can be one of the following values: COMPLETED, STARTING, STARTED, STOPPING, STOPPED, FAILED, ABANDONED, or UNKNOWN. Most of them are self explanatory: COMPLETED is the status set when a step or job has completed successfully, FAILED is set when it fails, and so on. ... At first glance, it would appear that on references the BatchStatus of the Step to which it belongs.
🌐
Spring
docs.spring.io › spring-batch › reference › spring-batch-intro.html
Spring Batch Introduction :: Spring Batch Reference
Spring Batch provides reusable functions that are essential in processing large volumes of records, including logging and tracing, transaction management, job processing statistics, job restart, skip, and resource management. It also provides more advanced technical services and features that enable ...
🌐
GitHub
gist.github.com › gksxodnd007 › 12a33a797953e2a0365db5ae5a333db6
spring batch job config · GitHub
Once you have a class annotated with it, you will have all of the above available. -> Each Configuration class has @EnableBatchProcessing annotation. As described in earlier, the JobRepository is used for basic CRUD operations of the various persisted domain objects within Spring Batch, such as JobExecution and StepExecution.
🌐
Medium
medium.com › @muratderman_94633 › introduction-to-spring-batch-c752e31ef24
Introduction to Spring Batch. Hi everyone ,In this tutorial I will do… | by Murat Derman | Medium
September 28, 2021 - In order to schedule our jobs we can use @Scheduled annotation It could be fixedRate which is in milliseconds or you can use cron expression. We need to add @EnableScheduling annotation in order to activate it.
🌐
Spring
docs.spring.io › spring-batch › docs › 4.3.8 › reference › html › job.html
Configuring and Running a Job
Spring 3 brought the ability to configure applications via java instead of XML. As of Spring Batch 2.2.0, batch jobs can be configured using the same java config. There are two components for the java based configuration: the @EnableBatchProcessing annotation and two builders.