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
2
votes
1 answer

Duplicate step detected in execution of job

So I've created a sample batch run to learn how to make a job repeat itself until a condition is met. For the most part, it's working as intended, but I'm getting the following log entry when I execute the…
canadiancreed
  • 1,966
  • 6
  • 41
  • 58
2
votes
1 answer

Using Spring Batch to write csv records to different SQL tables based on a field value

I'm working with an application where I'm required to translate various CSV files to an SQL database. Different CSV files may contain a variable number of columns but the first three will always be consistent between files. The files are being read…
MattSteel
  • 23
  • 3
2
votes
3 answers

How to continuously read files from a folder with spring-batch?

I'm using spring-batch to process multiple csv files from a folder using spring-batch. Similar as follows: @Bean public ItemReader reader() { MultiResourceItemReader reader = new MultiResourceItemReader<>(); …
membersound
  • 81,582
  • 193
  • 585
  • 1,120
2
votes
1 answer

ReaderNotOpenException in multithreaded process in spring batch

I tried to use Multithreaded for my step like below, but got an exception below: My step: Code:
Saranya
  • 21
  • 3
2
votes
0 answers

MapJobRepositoryFactoryBean in Spring Batch uses Jdbc-based Daos, not the Map-based

I am implementing a small REST-service, which runs batch job. I am not going to persist any metadata and my job is not parallel, so I've choosed MapJobRepositoryFactoryBean. And I also have H2 in classpath for other purposes. But when I trying to…
2
votes
0 answers

Spring Batch: AsyncItemProcessor and AsyncItemWriter

1) I have a large file (> 100k lines) that needs to be processed. I have a lot of business validation and checks against external systems for each line item. The code is being migrated from a legacy app and i just put these business logic into the…
2
votes
1 answer

Need info on Spring Batch and common connection pool

We have a requirement with one of the source applications which allows very few connections per user to its database. Since we have multiple spring batch interfaces connected to same source Db, we run out of connections, Spring batches run as…
ViS
  • 1,357
  • 1
  • 17
  • 36
2
votes
1 answer

Error creating bean with name 'scopedTarget.org.springframework.batch.repeat.policy.SimpleCompletionPolicy#0'

I'm using spring boot version 1.4.2.RELEASE and sprig batch framework. I'm trying to import data from files and after that storing results in a database, I'm dealing with a dynamic commit interval number so I implemented a method that returns the…
2
votes
2 answers

Accessing name of flat file from FlatFileItemReader LineMapper

I have a need to be able to access the name of the flat file that the current line being read is from. We are porting an application and some processes that are currently in place require this information. Here is my current configuration: private…
daniel0mullins
  • 1,937
  • 5
  • 21
  • 45
2
votes
2 answers

Spring Batch WriterNotOpenException

I have created a simple single-step Spring batch job that reads items from a DB, processes them and writes the result to a csv. During runtime I end up with a org.springframework.batch.item.WriterNotOpenException: Writer must be open before…
Unibit
  • 89
  • 1
  • 5
2
votes
2 answers

Spring batch with spring data

Is there a way to integrate spring batch with spring data? I see RepositoryItemReader and RepositoryItemWriter in spring documentation.
kaissun
  • 3,044
  • 4
  • 20
  • 35
2
votes
3 answers

Spring batch - write to two tables by extracting auto generated key

When using spring batch, I have a requirement to write the data to two different tables. It appears like I can use a CompositeItemWriter with as many ItemWriters as possible. However, I need to insert a record in the first table and retrieve the…
saravana_pc
  • 2,607
  • 11
  • 42
  • 66
2
votes
0 answers

Stop threads in spring batch while using taskExecutor(asyncTaskExecutor())

I have a issue here. When I am using this as my code (below) in spring batch configuration, my code ends successfully. @Bean(name = "myStep") public Step myStep() { int cores = Runtime.getRuntime().availableProcessors(); int maxAndQueueSize…
Shashank
  • 712
  • 15
  • 33
2
votes
2 answers

Spring batch admin upgrade

I am working on a application to upgrade it to JAVA 8. It is using spring integration, spring batch and spring batch admin. For spring integration and spring batch to work on java 8, we have to upgrade it to latest spring integration which is 4.3.5…
2
votes
1 answer

How to test a single step in Spring Batch without running others?

I have a spring batch application with a single job that runs two steps. I would like to be able to test each step individually without having to run the other. Is this possible? My code is as follows: @Bean public Job job() throws Exception { …
Locke
  • 534
  • 8
  • 25