Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

iwan77/mule-chunk-csv-into-database

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

10 Commits

Repository files navigation

Mule Example - Stream Gigabyte CSV into Database

Overview

This example Mule project shows how to stream a large CSV file into a database by splitting the file into smaller chunks. A custom Message Processor is used to split the CSV file by a predefined number of rows. Those chunks are then sent to a VM Queue and distributed to batch flows. Each batch flow inserts data using bulk mode through a batch commit into a MySQL database. Errors with records are caught and written to a file.

Components

  • Custom Message Processor
  • VM Queue
  • Batch Flow
  • Batch Commit
  • DataWeave
  • Choice Exception

Setup

  1. Setup database table with SQL Script under Resources
  2. Modify the 'mule-app.properties' file with your database credentials and folders the application will use to find the CSV file and where to drop the file after processing.
  3. In the application, set the number of rows to split the file by in the 'Set Line Group Size' component.
  4. Run the project.
  5. Drop the example CSV file into the folder where the application is pointed to.

Resources

About

Example Mule project that shows how to upload a large CSV file into database as chunks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages

  • Java 100.0%

AltStyle によって変換されたページ (->オリジナル) /