Spring Boot Batch – Stop and Start a multithreaded step with CompositeItemWriter

I am trying to stop and start a multithreaded step through Scheduler. But I am getting exception as Caused by: org.springframework.dao.InvalidDataAccessResourceUsageException: Unexpected cursor …

Using LocalDate in Spring context and avoid CGLib issue

I have a small job written with Spring Boot Batch 2.2.2. It takes a date as a parameter, and since several components need that date, I place it as a bean in the Spring context : @Bean @StepScope …

How to use DefaultJobParametersValidator in Java-configured Spring Batch application?

How can I use DefaultJobParametersValidator in a Java-based Spring Batch Application? Should I call it manually in a Tasklet? I cannot find any examples that does not used an xml configuration.

How to pass data into spring batch ItemProcessor?

I have a CSV file that contains records of data (cases), for which I created a caseDTO object , however some of the properties of the caseDTO must be field from data included in the file name (every …

Spring Batch @BeforeContext Fails to Execute

I have a situation in spring batch where I have multiple item processors that make up a composite item processor. I need to share some context data between two processors in the same step. I have …

Spring SFTP : Unable to rename .writing file

I am using Spring SFTP integration to transfer the file and many time I got this error. It seems two threads are trying to transfer same file and conflict with each other 2020-08-03 08:31:55,766 INF […

Spring Batch : Remove stack trace of run time exception from exit description

In my Spring Batch Job if there is an unhandled exception in step ItemWriter (for ex Primary Key Violation because of bad data while saving to DB), my job fails and then I get another error because …

Spring batch FileItemWriter not creating file at correct path

I have a spring batch service containing a FileItemReader,FileItemProcessor and FileItemWriter.When creating the FileItemWriter I have to set the Resource that will be my output file. I am running …

Spring dynamically choosing between data sources (alternative to ThreadLocal)

I’ve read about AbstractRoutingDataSource and the standard ways to bind a datasource dynamically in this article: public class CustomerRoutingDataSource extends AbstractRoutingDataSource { @…