Code Monkey home page Code Monkey logo

springboot_batchprocessing's Introduction

SpringBoot_BatchProcessing

SpringBoot_BatchProcessing /** *

  • reader() -> creates ItemReader which looks for sample-data.csv file and parse each item to transform information into User object

  • processer() -> creates instance of our UserProcessor

  • writer() -> create itemWriter which is aimed to JDBC Destination and gets dataSource created by @EnableBatchProcessing it also includes SQL statement needed to insert User to db.

  • csvToDbJob() -> defines Job. Jobs are built from Steps each job involve reader, processor and writer.

  •    In this Job Defination we need incrementer because jobs use a database to maintain execution state.You then list each 			step, of which 	this job has only one step.
    
  • The job ends, and the Java API produces a perfectly configured job.

  • csvToDbStep() -> In the step definition, you define how much data to write at a time.

  • In this case, it writes up to ten records at a time.

  • Next, you configure the reader, processor, and writer using the injected bits from earlier.

  • chunk() is prefixed <User,User> because it’s a generic method.

  • This represents the input and output types of each "chunk" of processing, and lines up with ItemReader and ItemWriter.

    • JobCompletionNotificationListener -> listens for when a job is BatchStatus.COMPLETED, and then uses JdbcTemplate to inspect the results.
    • @Configuration tags the class as a source of bean definitions for the application context
    • @EnableAutoConfiguration tells Spring Boot to start adding beans based on classpath settings, other beans, and various property settings.
    • Normally you would add @EnableWebMvc for a Spring MVC app, but Spring Boot adds it automatically when it sees spring-webmvc on the classpath.
    • This flags the application as a web application and activates key behaviors such as setting up a DispatcherServlet
    • @ComponentScan tells Spring to look for other components, configurations, and services in the which package, allowing it to find the controllers. */

springboot_batchprocessing's People

Contributors

vivekrajyaguru avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.