Questions tagged [spring-batch]

Spring Batch is a lightweight, comprehensive framework aimed at enabling the development of batch applications vital for the daily operations of enterprise systems. Batch applications in this context refers to automated offline systems targeted towards bulk data processing.

Spring Batch is a lightweight, comprehensive framework aimed at enabling the development of batch applications vital for the daily operations of enterprise systems. Batch applications in this context refers to automated offline systems targeted towards bulk data processing. Spring Batch automates this basic batch iteration, providing the capability to process similar transactions as a set, typically in an offline environment without any user interaction.

Spring Batch works by reading data with a configurable chunk size from a data source, processing it and finally writing it to a resource.
The data source (i.e. process input) and the data sync (i.e. process output) can be flat files (text file, XML file, CSV file...), SQL Databases (MySQL...) or NoSQL databases (MongoDB...).

Related Tags

Online Resources

8349 questions
8
votes
3 answers

Spring Batch Java Config JobLauncherTestUtils

I am currently working on a spring boot project that uses spring batch. I am trying to use JavaConfig instead of xml but it's difficult with all of the docs currently in xml. I followed…
Greg Potter
  • 527
  • 1
  • 5
  • 18
8
votes
4 answers

Spring batch and Integration

I am a beginner to Spring and I have to do a project for school. What kind of project can I do which I can use Spring Batch and Integration. I know that I can write files into directories, write, read and modify comma separated files but I can`t…
nobo
  • 91
  • 1
  • 5
8
votes
1 answer

Using FlatFileItemReader with a TaskExecutor (Thread Safety)

There are a lot of examples which use FlatFileItemReader along with TaskExecutor. I provide samples below (both with XML and Java Config): Using Oracle Coherence with Spring Batch Spring Batch Multithreading Example I have used it my self with XML…
kmandalas
  • 418
  • 1
  • 5
  • 17
8
votes
6 answers

Unable to detect database type

I'm trying to create a Spring Boot application using sqljdbc4 driver with this config: spring: datasource: url: "jdbc:sqlserver://dbhost:1433;databaseName=test" username: dbuser password: dbuser tomcat: test-on-borrow: true …
Marcus Henrique
  • 762
  • 1
  • 5
  • 15
8
votes
3 answers

Cannot resolve bean in SpEL for Spring Data MongoDB collection name

I am trying to customize the collection name where an entity class is saved into and indexed, using Spring Data MongoDB and Spring Batch. The class is declared as follows: @Document @CompoundIndex(name = "unique_source", def = "{'fid': 1, 'sid':…
8
votes
2 answers

What is the best way to test job flow in Spring-Batch?

I've got a complicated batch application, and I want to test that my assumptions about flow are correct. Here's a much simplified version of what I'm working with:
Jon Bristow
  • 1,675
  • 3
  • 27
  • 42
8
votes
4 answers

Spring Batch - How to prevent database commits with jobLauncherTestUtils

I have Spring Batch job that writes to the database (it has a step with a JpaItemWriter). I have an integration test such as follows: @RunWith(SpringRunner.class) @SpringBootTest @ActiveProfiles("integrationTest") public class LoadApplicationTests…
James
  • 2,876
  • 18
  • 72
  • 116
8
votes
1 answer

Single job execution across multiple servers

I have setup where multiple servers run a @Schedule which run a spring batch job that sends out emails to users. I want to make sure that only one instance of this job is ran across multiple servers. Based on this question I have implemented some…
Edd
  • 1,982
  • 2
  • 21
  • 29
8
votes
2 answers

How to solve "Unhandled exception type BeansException"

I am a beginner at Spring Batch. I am following this guide to create a HelloWorld of Spring Batch. In the class with main method when I was trying to get Application Context by using new ClassPathXmlApplicationContext("..."), the IDE shows an error…
karansky
  • 538
  • 1
  • 4
  • 24
8
votes
1 answer

How to configure EntityManagerFactoryBuilder bean when testing Spring Boot Batch application?

I have a Spring Boot Batch application that I'm writing integration tests against. However, I'm getting the following error about the EntityManagerFactoryBuilder bean missing when running a…
James
  • 2,876
  • 18
  • 72
  • 116
8
votes
1 answer

How to achieve distributed processing of steps using Spring Batch

Using Spring batch, I want my steps to be distributed across nodes and get them executed for a given job. I have a usecase where a job has multiple steps and each step can run in multiple nodes where the app is hosted. Has anybody tried this ? Any…
Ashu NCS
  • 89
  • 1
  • 6
8
votes
1 answer

FlatFileParseException Parsing error - Spring Batch

I follow this tutorial and I'm getting FlatFileParseException error: org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 1 in resource=[class path resource [country.csv]], …
usil
  • 623
  • 1
  • 9
  • 20
8
votes
0 answers

Spring Batch + Spring Boot - shutdown process

I'm new to Spring Batch and I can't figure out how to terminate the Spring Boot process after job is finished. In my BatchConfiguration class i configure jobs and steps: @Configuration @EnableBatchProcessing @EnableAutoConfiguration public class…
s1moner3d
  • 1,141
  • 2
  • 16
  • 35
8
votes
2 answers

Reading from streams instead of files in spring batch itemReader

I am getting a csv file as a webservice call which needs to be laoded. Right now I am saving it in temp directory to provide it as setResource to Reader. Is there a way to provide stream(byte[]) as is instead of saving the file first?
explorer
  • 486
  • 1
  • 6
  • 19
8
votes
3 answers

Spring batch job exit status for failed step

I recently upgraded an old application using Spring Batch 2.2.0 to 3.0.5. I made the necessary changes to the DB tables and some minute code changes related to parameter APIs. Now when I run the application it is working but if a step's exit status…
Jit B
  • 1,206
  • 14
  • 26