flâneur — a map of the web's best reading

Spring Batch - Tasklets vs Chunks | Baeldung

baeldung.com · 3,483 words · saved by 1 readers

In this article, we’ll learn how to configure and implement both methods using a simple real-life example. Let’s get started by adding the required dependencies: To get the latest version of spring-batch-core and spring-batch-test, please refer to Maven Central. Let’s consider a CSV file with the following content: The first position of each line represents a person’s name and the second position represents his/her date of birth. Our use case is to generate another CSV file that contains each person’s name and age: Now that our domain is clear let’s go ahead and build a solution using both approaches. We’ll start with tasklets. Tasklets are meant to perform a single task within a step. Our job will consist of several steps that execute one after the other. Each step should perform only one defined task. Our job will consist of three steps: Now that the big picture is ready, let’s create one class per step. LinesReader will be in charge of reading data from the input file: LinesProcesso

eBook – Guide Spring Cloud – NPI EA (cat=Spring Cloud) Let's get started with a Microservice Architecture with Spring Cloud: >> Join Pro and download the eBook eBook – Mockito – NPI EA (tag = Mockito) Mocking is an essential part of unit testing, and the Mockito library makes it easy to write clean and intuitive unit tests for your Java code. Get started with mocking and improve your application tests using our Mockito guide : Download the eBook eBook – Java Concurrency – NPI EA (cat=Java Concurrency) Handling concurrency in an application can be a tricky pr

Explore this link on the map →

related reading