Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Batch Processing

Batch Processing

Deck from the Batch Processing in Action presentation

Rodrigo Graciano

April 11, 2022
Tweet

More Decks by Rodrigo Graciano

Other Decks in Programming

Transcript

  1. WHAT SPRING BATCH IS? Spring Batch is a lightweight, comprehensive

    batch framework designed to enable the development of robust batch applications vital for the daily operations of enterprise systems. https://docs.spring.io/spring-batch/docs/current/reference/html/index-single.html#spring-batch-intro
  2. WHAT SPRING BATCH IS NOT? Spring Batch is not a

    scheduler https://docs.spring.io/spring-batch/docs/current/reference/html/index-single.html#spring-batch-intro
  3. SHOW ME SOME CODE: BASIC DEMO This Photo by Unknown

    Author is licensed under CC BY-NC-ND
  4. • JobRepository • JobLauncher • JobRegistry • JobExplorer • PlatformTransactionManager

    • JobBuilderFactory • StepBuilderFactory @EnableBatchProcessing
  5. SHOW ME SOME CODE: RUNNING JOBS This Photo by Unknown

    Author is licensed under CC BY-NC-ND
  6. RUNNING JOBS • From the command Line (CommandLineJobRunner) • Within

    a web container • Synchronous x Asynchronous
  7. MORE CODE MORE CODE: PROCESSORS & CHUNKS This Photo by

    Unknown Author is licensed under CC BY-NC-ND
  8. READERS • Database (JDBC, Mongo, Neo4j, Hibernate, etc.) • Flat

    Files (delimited, fixed-length) • XML, JSON • JMS, Kafka, Amqp • Multi-file
  9. MULTI-FILE READER •Read multiple file in a single step •Files

    must have the same format •Works with XML, JSON and flat files
  10. WRITERS • Database (JDBC, Mongo, Neo4j, Hibernate, etc.) • Flat

    Files (delimited, fixed-length) • XML, JSON • JMS, Kafka, Amqp • Multi-file • Email
  11. TASKLETS • 1 time operation instead of read/write • Run

    a DB query • Copy Files • Zip/unzip files
  12. STEP LISTENERS • before/after step StepExecutionListener • before/after read •

    onReadError ItemReadListener • before/after write • onWriteError ItemWriteListener
  13. STEP LISTENERS • before/after/after error chunk ChunkListener • before/after process

    • onProcessError ItemProcessListener • onSkipInRead • onSkipInProcess • onSkipInWrite SkipListener
  14. SCALING AND PARALLEL PROCESSING • Multi-threaded (Async Executor) • Parallel

    steps (Split) • Remote Chunking (Data processed by slaves – Real data sent not a reference) • Remote Partitioning (Data in chunks and local to slaves)
  15. JOB Job JobInstance JobExecution JobParameters Present at Devnexus title =

    Batch Processing in Action Present Batch Processing in Action at Devnexus First try to present – hopefully, it will work