DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Batch Processing Large Data Sets with Spring Boot and Spring Batch
  • Actuator Enhancements: Spring Framework 6.2 and Spring Boot 3.4
  • How Spring Boot Starters Integrate With Your Project
  • SmartXML: An Alternative to XPath for Complex XML Files

Trending

  • Building Threat Intelligence Pipelines Using Python, APIs, and Elasticsearch
  • How to Parse Large XML Files in PHP Without Running Out of Memory
  • 5 Failure Patterns That Break AI Chatbots in Production
  • Why Round-Robin Won't Save You: Load Balancing Challenges in Data Streaming Services With Heterogeneous Traffic
  1. DZone
  2. Coding
  3. Frameworks
  4. Spring Batch Process XML Delete/Move Files After Processing

Spring Batch Process XML Delete/Move Files After Processing

This example covers multiple Spring Batch concepts that we need in most of our daily routine batch job implementations.

By 
Damodhara Reddy Palavali user avatar
Damodhara Reddy Palavali
·
Jul. 11, 19 · Code Snippet
Likes (2)
Comment
Save
Tweet
Share
17.9K Views

Join the DZone community and get the full member experience.

Join For Free

Image title

See how Spring Boot Batch Application saves an XML to the database and moves error/success files to error/success folder and archives error/success files.

This example covers multiple Spring Batch concepts that we need in most of our daily routine batch job implementations.

List of topics covered

Before going through this article, I assume you know about the basic concepts of Spring Boot, Batch, and how to create a project. This topic starts by creating classes required for the implementation of the current topic. If you are new to Spring batch, Spring Boot uses Spring Initializr to create projects. You can refer to the Spring Boot Documentation

List of topics covered:

  1. Multiple schedulers in one configuration

  2. Parse XML nested elements to DB

  3. Tasklet to move file

  4. Tasklet to archive and delete file

  5. StepExecutionListener

We are using Stax.

SQL to create table:

CREATE TABLE “TEST_VEHICLE1” 
 ( “ID” NUMBER(19,0) NOT NULL ENABLE, 
 “VEHICLENUMBER” VARCHAR2(10 BYTE), 
 “BRAND” VARCHAR2(100 BYTE), 
 “COUNTRY” VARCHAR2(100 BYTE), 
 “MODELNAME” VARCHAR2(35 BYTE), 
 “MODELYEAR” VARCHAR2(35 BYTE), 
 PRIMARY KEY (“ID”)
 ) ;

Go to GitHub for the complete code. Happy coding!

Spring Framework XML Spring Batch Spring Boot Processing

Opinions expressed by DZone contributors are their own.

Related

  • Batch Processing Large Data Sets with Spring Boot and Spring Batch
  • Actuator Enhancements: Spring Framework 6.2 and Spring Boot 3.4
  • How Spring Boot Starters Integrate With Your Project
  • SmartXML: An Alternative to XPath for Complex XML Files

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook