Skip to content
Advertisement

Tag: spring-batch

How Spring Batch Step chunkSize and JpaPagingItemReader pageSize work together

Im developing a Spring Batch application. Although I’m getting more and more comfortable with it, I came across with something that is making me very confused. Please take a look at this step configuration. As you can see it’s a pretty standard step. My confusion is related to the chunk size (50) and the reader (processNonExportedMbfsOperationsItemReader). Reader code next: The

How to inject ObjectMapper in spring

I have a batch job written using Spring Batch I have a config file below: I have Json Line aggregator as below: I want to inject objectMapper and don’t want to create it inside the JsonLineAggregator class. Any idea how can I implement it using DI ? Answer You can use @Autowired annotation to inject the dependency in spring like

The dependencies of some of the beans in the application context form a cycle in Spring Batch

I’m working on a simple Spring Batch application, and when I finished configuring it, I found that problem: The dependencies of some of the beans in the application context form a cycle: jobRestController defined in file [/home/yassine/Downloads/demo/target/classes/com/example/demo/JobRestController.class] springBatchConfig defined in file [/home/yassine/Downloads/demo/target/classes/com/example/demo/SpringBatchConfig.class] Action: Relying upon circular references is discouraged and they are prohibited by default. Update your application to remove

Error creating bean with name ‘batchDataSource’: Requested bean is currently in creation: Is there an unresolvable circular reference?

I have a batch configuration. I saw the batch process is default using InMemoryMap. Instead I need to use the MySQL to send all the execution details by Batch. But when I use the following code I am getting the following error, Error creating bean with name ‘batchDataSource’: Requested bean is currently in creation: Is there an unresolvable circular reference?

Why this error trying to unit test an entire Spring Batch Job? No qualifying bean of type ‘org.springframework.batch.core.Job’ available

I am working on a Spring Batch application. Untill now I was able to unit test something like service methods and something like this (as done in every Spring Boot application). Now I am trying to follow this tutorial in order to test an entire job from my unit test class (basically I want to execute a test method that

Why am I obtaining this error trying to start multiple Spring Batch Jobs? The bean ‘jobLauncher’….could not be registerd

I am working on a Spring Batch application containing two different Job bean (representing two different jobs). Both these jobs must be performed by my application (at the moment it can be done both sequentially and in parallel. It is not so important at the moment). In order to achieve this behavior I am trying to follow this documentation but

How to iterate over StaxEventItemReader/itemreader?

Currently I want to access the objects inside StaxEventItemReader. This is done by using StaxEventItemReader.read() (xml-file has 50 objects/items), so that I can do something with these objects. The question is how you can correctly iterate over the items of StaxEventItemReader? Originally I had something like this: The problem is that read() “reads a piece of input data and advance

explain how JobLauncherApplicationRunner class works?

I was reading the source code of JobLauncherApplicationRunner. according to my understanding when we use Spring boot + Spring batch, this class is used to find all the jobs in the application context and use SimpleJobLauncher to execute jobs in startup. I found some cases that contradicts my previous knowledge and if you help me out I will be grateful

Advertisement