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
10
votes
5 answers

How can I qualify an autowired setter that I don't "own"

The gist is that the Spring Batch (v2) test framework has JobLauncherTestUtils.setJob with an @Autowired annotation. Our test suite has multiple Job class providers. Since this class is not something I can modify, I'm not sure how I can qualify…
xenoterracide
  • 16,274
  • 24
  • 118
  • 243
10
votes
6 answers

NoSuchJobException when running a job programmatically in Spring Batch

I have a Job running on startup. I want to run this job programmatically at a particular point of my application, not when I start my app. When running on startup I have no problem, but I got a "NoSuchJobException" (No job configuration with the…
Carrm
  • 1,485
  • 3
  • 24
  • 45
10
votes
1 answer

How do I skip/delete an item in the ItemProcessor?

I want to be able to delete an item while processing it if it fits a specific logic. For example, if the item doesn't contain a value I'm looking for, I don't want to that item to be written out to the file. I'm currently using a class which…
samwell
  • 2,757
  • 9
  • 33
  • 48
10
votes
2 answers

Spring Batch skip exception for ItemWriter

I'm trying to use Spring Batch 2.2.5 with Java config. Here is the config that I have: @Configuration @EnableBatchProcessing public class JobConfiguration { @Autowired private JobBuilderFactory jobBuilder; @Autowired private…
caffeine_inquisitor
  • 617
  • 1
  • 9
  • 21
10
votes
3 answers

JpaItemWriter: no transaction is in progress

I'd like to use JpaItemWriter to batch persist entities. But when I use the following code to persist, I'm told: Hibernate: select nextval ('hibernate_sequence') [] 2014-03-19 15:46:02,237 ERROR : TransactionRequiredException: no…
membersound
  • 81,582
  • 193
  • 585
  • 1,120
10
votes
3 answers

Spring Batch - Counting Processed Rows

So I am creating a Spring Batch job for reading a CSV file and for certain rows which contain incomplete data; it checks, outputs to the log that the row is incomplete, and skips. It works great except at the end of the job I want it to log how many…
dogfight
  • 193
  • 1
  • 1
  • 7
10
votes
4 answers

Spring Batch : Tasklet with multi threaded executor has very bad performances related to Throttling algorithm

Using Spring batch 2.2.1, I have configured a Spring Batch Job, I used this approach: http://static.springsource.org/spring-batch/reference/html/scalability.html#multithreadedStep Configuration is the following: Tasklet uses…
pmpm
  • 705
  • 1
  • 5
  • 20
10
votes
2 answers

H2 SQL Grammar Exception

I am trying to import a sql script for H2. This script is provided by spring-batch and it's used to store the jobs metadata. When I execute this script directly in the H2 console, I have no syntax errors, but I referenced the same script in…
Dimitri
  • 8,122
  • 19
  • 71
  • 128
10
votes
2 answers

How is the skipping implemented in Spring Batch?

I was wondering how I could determine in my ItemWriter, whether Spring Batch was currently in chunk-processing-mode or in the fallback single-item-processing-mode. In the first place I didn't find the information how this fallback mechanism is…
Peter Wippermann
  • 4,125
  • 5
  • 35
  • 48
10
votes
4 answers

File processing on two different machine using spring batch

My file processing scenario is , read input file -> process -> generated output file but i have to two physically different machines which are connected to one storage area where i receive all the input files and one database server,There are two…
neel.1708
  • 315
  • 1
  • 4
  • 18
10
votes
3 answers

Spring batch: Writing column names as first line in flat file

I want to create a flat file which has the below format: Col1Name;Col2Name;Col3Name one;23;20120912 two;28;20120712 As seen, the first line in the flat file are the column names. How to achieve this through header callback ? I see that if the…
Vicky
  • 16,679
  • 54
  • 139
  • 232
9
votes
2 answers

Spring Batch Deadlock - Could not increment identity; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException

We are in the process of moving to Azure SQL Server from Oracle DB for our Spring Batch application. I am getting the following error while trying to execute two different jobs at the same time that updates different tables however uses the same…
One Developer
  • 99
  • 5
  • 43
  • 103
9
votes
2 answers

SpringBatch - Step no longer executing: Step already complete or not restartable

I have a single step springbatch application. The job is as follows: @Bean public Job databaseCursorJob(@Qualifier("databaseCursorStep") Step exampleJobStep, JobBuilderFactory jobBuilderFactory) { return…
Timothy Clotworthy
  • 1,960
  • 2
  • 19
  • 42
9
votes
4 answers

Spring Batch 4.2.4: Unable to deserialize the execution context

I was using spring-batch:4.2.2.RELEASE as part of spring-boot-starter-batch:2.2.4.RELEASE. After upgrading the latter to version 2.3.1.RELEASE, I get the following exception when starting a job: java.lang.IllegalArgumentException: Unable to…
kpentchev
  • 3,040
  • 2
  • 24
  • 41
9
votes
3 answers

java.lang.IllegalStateException: InputStream has already been read - do not use InputStreamResource if a stream needs to be read multiple times

I am trying to read a file from aws s3 bucket and set it as resource inside my spring batch reader class. When I test the application on aws lambda function I got below error. any suggestion experts? Caused by: java.lang.IllegalStateException:…
Maana
  • 640
  • 3
  • 9
  • 22