Questions tagged [spring-batch-tasklet]

135 questions
1
vote
0 answers

Issue with MultiResourceItemReader in Spring batch

I'm trying to read multiple files from S3 bucket and processing using MultiResourceItemReader, I'm getting ArrayStoreException while executing the below line InputStreamResource[] resources = resourceList.toArray(new…
Brady Maf
  • 1,279
  • 2
  • 5
  • 12
1
vote
1 answer

Handle Job param validation in spring batch

I'm using Spring batch for our batch processing, before I do batch processing I would like to do validate all job params like productName, productID, start date, end date, productType, if these Job params are null or contains bad value I have to…
Dave Brady
  • 193
  • 9
1
vote
1 answer

Spring batch entire Job in transaction boundary

I have a use-case for which I could use spring batch job which I could design in following ways. 1) First Way: Step1 (Chunk oriented step): Read from the file —> filter, validate and transform the read row into DTO (data transfer object), if there…
Sagar
  • 5,315
  • 6
  • 37
  • 66
1
vote
1 answer

Springboot+Job Framework

My requirement is whenever we call certain RestAPI from UI/Postman, At backend it should trigger JOB that perform several operations/task. Example: Assume some POST Rest API is invoked - It should invoke "Identify-JOB"(performs several activities)-…
1
vote
1 answer

spring batch flat file reader access header and footer variables to use in Writer

I am using spring batch flatfile reader to read a file with header and footer values. Below is sample file and output file should have every record appended with header date and file sequence. Sample input and output as below. Can someone please…
Teja
  • 69
  • 7
1
vote
0 answers

Get previous chunk values to the current processing chunk - spring batch

I have an application on Spring batch, I have used Chunk Oriented programming, in that I have extended FlatFileItemWriter class to generate the output file. The problem is I will be having more than 1000 records as input and the chunk value is 100.…
Yaswanth
  • 483
  • 1
  • 9
  • 25
1
vote
1 answer

how to add extra information in the COLUMN(may be FIELD) short_context of TABLE batch_step_context?

1.Problem Summary After I run a job, I see the TABLE batch_step_context like the pic: screenshot of the table The beautiful information of the FIELD short_context is: { "batch.taskletType":…
tequila
  • 23
  • 4
1
vote
1 answer

Spring Batch: Implementing stop method in StoppableTasklets

I am calling the following piece to stop the job. Set executions = jobOperator.getRunningExecutions("Job-Builder"); jobOperator.stop(longExecutions.iterator().next()); The above method is stopping the job but Tasklets are still running. After…
1
vote
1 answer

How to assess whether to use spring batch or scheduler in application?

I have a business logic already developed in spring boot that needs to be run once in every 60 days. I'm little confused on whether convert it to spring batch or use scheduler annotation. What all factors should I consider to assess the same? Does…
1
vote
2 answers

Spring Batch - Read multiple files from S3

Like for reading single file in spring batch from s3, we use @Bean public FlatFileItemReader> itemReader() { FlatFileItemReader> reader = new FlatFileItemReader<>(); reader.setLineMapper(new…
1
vote
2 answers

Log read, write and error counts with Spring batch

I have a Sprint batch with the job as
Sooraj
  • 73
  • 8
1
vote
1 answer

how to preserve database connection while thread is blocked

The database i'm integrated is configured as if a connection is idle(not being used for a while), then connection is dropped. Since im using spring batch in persistent configuration, there is always an active database connection on running…
1
vote
1 answer

FlatFileItemWriter not generating the file when using Tasklet approach

I wrote the following code using tasklet approach to generate a file with data. public class PersonInfoFileWriter implements Tasklet { @Autowired PersonInfoFileUtil personInfoFileUtil; public void…
1
vote
0 answers

Spring Batch skip exception and rollback in Tasklet

I want to achieve a tasklet that can skip exceptions and rollback the transaction properly and I don't see a way to accomplish both things. My tasklet reads from a queue of ids that gets filled in the constructor. In each invocation of the execute…
Youssef Khloufi
  • 685
  • 3
  • 13
  • 24
1
vote
1 answer

Spring batch how to get job execution context in Skip Listener

I am looking for help to find out a way to set job execution context in my chunk Listener. @Bean public Step testStep( JdbcCursorItemReader testStageDataReader, TestStepProcessor testStepProcessor, …
JDev
  • 1,662
  • 4
  • 25
  • 55
1
2
3
8 9