Member-only story

Spring Batch 5 — Read from MongoDB and generate CSV files: Part 2

Eric Anicet
6 min readJan 29, 2024

--

In the previous story, we provided an overview of Spring Batch and the new features introduced in Spring Batch 5.x.
In this story, we are going to implement a code with Spring Batch 5 and MongoDB.

· Prerequisites
· Real-world examples
· Getting Started
Setup project
Source code implementation
· Spring batch application Demo
· Conclusion
· References

Prerequisites

This is the list of all the prerequisites:

  • Spring Boot 3+
  • Maven 3.6.+
  • Java 17 or later
  • Mongo 5.x or later

Real-world examples

We will take bicycle trip data from the Citibike service in New York City as an example.

CitiBike is New York City’s bike-share system, and the largest in the nation. CitiBike launched in May 2013 and has become an essential part of the transportation network.

Let’s suppose Citibike uses MongoDB as the database to store bike trip data. The trip documents are composed of:

--

--

Responses (1)