Questions tagged [spring-batch-tasklet]
135 questions
0
votes
1 answer
How to call StepExcecutionListener in spring batch with kafka integration?
Below is the config of job in etl.xml
…

swetha
- 91
- 2
- 11
0
votes
1 answer
To user Tasklet or Chunk in this scenario
I have a job/task to read sub-folders/directory of a given folder/path. The path is dynamic, we get it from Controller. Currently, I have used Tasklet, there are 3 tasklets, one to read sub-directories, another to process it to prepare objects to…

SudeepShakya
- 571
- 3
- 14
- 34
0
votes
0 answers
Will Spring FlatFileItemWriter delay to write to file?
I have a Spring batch that will write data into a text file, after write to the text file, the batch has another step to rename the file and do backup. The following is part of my code in my batch xml:

Panadol Chong
- 1,793
- 13
- 54
- 119
0
votes
1 answer
Spring Batch: Terminating the current running job
I am having an issue in terminating the current running spring batch. I wrote
Set executions = jobOperator.getRunningExecutions("Job-Builder");
jobOperator.stop(longExecutions.iterator().next());`
in my code after going through the spring…

Vamsi
- 619
- 3
- 9
- 22
0
votes
1 answer
How to specify the taskexecutor to spawn thread after reading a single csv by using MultiResourceItemReader in spring batch
Trying to read multiple files in spring batch using MultiResourceItemReader and also have taskExecutor for the records in each file to read in multithreading. Suppose there are 3 csv files in a folder, MultiResourceItemReader should execute it one…

drp111
- 1
- 2
0
votes
1 answer
Using Multiple DataSource in Spring Batch Tasklet
I am new to spring batch, and I'm encountering an issue when using multiple data source in my batch.
Let me explain.
I am using 2 databases in my server with Spring Boot.
So far everything worked fine with my implementation of…

north_animal
- 1
- 1
0
votes
1 answer
Using SystemCommandTasklet to split file
I want to run System Commands via SystemCommandTasklet.Itried this with the sample code below but I get an error.
I think this because of command parameter,But I could not fix it.
I would be very glad if it will help.
Reference Examples ;
Using…

musti
- 21
- 6
0
votes
2 answers
Send data to Spring Batch Item Reader (or Tasklet)
I have the following requirement:
An endpoint http://localhost:8080/myapp/jobExecution/myJobName/execute which receives a CSV and use univocity to apply some validations and generate a List of some pojo.
Send that list to a Spring Batch Job for…

alobaton
- 113
- 8
0
votes
1 answer
Spring Batch: How to cast stepContext.getJobExecutionContext() into custom Map implementation in mockito when then
This question is related to This. Why I am asking here and not updating the question, because this can be helpful question and not related to the previous one which I have asked.
In a Test class how I can cast the below implementation:
Lets say I…

Jaadu
- 83
- 7
0
votes
1 answer
Spring batch:Test case for Tasklet - Key is not appearing in actual class when it is invoked from Test class
I am trying to learn Batch and Tasklet.
I am writing a test case for a Tasklet code in spring batch. I am setting a map in my Test class and debug, the actual class is not having the key which I am passing from my test…

Jaadu
- 83
- 7
0
votes
1 answer
Is it possible to have two different Spring Batch JobRegistry configured against two different JobRepositories?
I have an application where I have configured two different jobRepository(ies) for different category of jobs; now I want to run all jobs of one category. I tried using JobRegistry but it has jobs from both the job repositories.
How can I get the…

Jaraws
- 581
- 1
- 7
- 24
0
votes
1 answer
How to form XML dynamically based on configruaiton in Spring Batch
I have to read the data from a DB table and converts it into a XML file.
Also, the fields(columns of the table) that that needs to converted as XML should be configuration driven(property file or configuration table) .
I have completed the first…

user1346346
- 195
- 2
- 16
0
votes
0 answers
Getting Null Pointer Exception while executing a spring batch tasklet step
As the question suggests I am getting an java.lang.NullPointerException while trying to run a batch job with two steps. One of the steps is a simple tasklet where as the other one is chunk based. The batch job is currently being run through a REST…

Mr. T
- 356
- 3
- 17
0
votes
2 answers
Clean spring batch metadata mongodb
I am using Spring Batch MongoDB API. In order to free up some space in my MongoDB, I decided to clean up the job execution metadata by deleting any data older than two months from the following collections :
- JobInstance
- JobExecution
-…

ZenRadLad
- 82
- 1
- 12
0
votes
1 answer
FlatFileItemWriterBuilder-headerCallback() get number of rows written
Is it possible to get the total number of rows written from FlatFileItemWriter.headerCallback()?
I am a spring-batch nubee and I looked at putting count of lines into header of flat file and Spring Batch - Counting Processed Rows.
However I can't…

Faiyet
- 5,341
- 14
- 51
- 66