Java HTML
Latest commit a5a0c61 Oct 16, 2017 @benas benas remove deprecated APIs
Permalink
Failed to load latest commit information.
easybatch-archetype issue #283: configure maven-jar-plugin to use the manifest generated … Oct 16, 2017
easybatch-benchmarks Update readme.md Oct 2, 2017
easybatch-core remove deprecated APIs Oct 16, 2017
easybatch-extensions issue #297: remove boolean parameter from method JobBuilder#enableJmx Oct 16, 2017
easybatch-flatfile issue #283: configure maven-jar-plugin to use the manifest generated … Oct 16, 2017
easybatch-jdbc issue #283: configure maven-jar-plugin to use the manifest generated … Oct 16, 2017
easybatch-jms remove deprecated APIs Oct 16, 2017
easybatch-jpa issue #283: configure maven-jar-plugin to use the manifest generated … Oct 16, 2017
easybatch-json issue #283: configure maven-jar-plugin to use the manifest generated … Oct 16, 2017
easybatch-test-common issue #283: configure maven-jar-plugin to use the manifest generated … Oct 16, 2017
easybatch-tools issue #283: configure maven-jar-plugin to use the manifest generated … Oct 16, 2017
easybatch-tutorials issue #296: rename FilteredCount metric with FilterCount Oct 15, 2017
easybatch-validation issue #283: configure maven-jar-plugin to use the manifest generated … Oct 16, 2017
easybatch-xml remove deprecated APIs Oct 16, 2017
.gitignore add eclipse files to .gitignore Mar 18, 2016
.travis.yml use openjdk7 instead of oraclejdk7 Sep 11, 2017
LICENSE.txt update license Oct 15, 2017
README.md issue #280 : invert listeners call order Oct 14, 2017
appveyor.yml Create appveyor.yml Oct 5, 2017
licence-header-template.txt add maven license plugin Feb 17, 2017
pom.xml issue #283: configure maven-jar-plugin to use the manifest generated … Oct 16, 2017

README.md


Easy Batch
The simple, stupid batch framework for Java™

MIT license Coverage Build Status Build status Maven Central Javadoc Gitter


Latest news

  • 05/06/2017: Version 5.1.0 is out! See what's new here.

What is Easy Batch?

Easy Batch is a framework that aims to simplify batch processing with Java. Writing batch applications requires a lot of boilerplate code: reading, writing, filtering, parsing and validating data, logging, reporting to name a few.. The idea is to free you from these tedious tasks and let you focus on your application's logic.

How does it work?

Easy Batch jobs are simple processing pipelines. Records are read in sequence from a data source, processed in pipeline and written in batches to a data sink:

batch processing

The framework provides Record and Batch APIs to abstract data format and process records in a consistent way regardless of the data source type.

Let's see a quick example. Suppose you have the following tweets.csv file:

id,user,message
1,foo,hello
2,bar,@foo hi!

and you would like to transform these tweets to XML format. Here is how you can do that with Easy Batch:

Job job = new JobBuilder()
         .reader(new FlatFileRecordReader("tweets.csv"))
         .filter(new HeaderRecordFilter())
         .mapper(new DelimitedRecordMapper(Tweet.class, "id", "user", "message"))
         .marshaller(new XmlRecordMarshaller(Tweet.class))
         .writer(new FileRecordWriter("tweets.xml"))
         .batchSize(10)
         .build();

JobExecutor jobExecutor = new JobExecutor();
JobReport report = jobExecutor.execute(job);
jobExecutor.shutdown();

This example creates a job that:

  • reads records one by one from the input file tweets.csv
  • filter the header record
  • map each record to an instance of the Tweet bean
  • marshal the tweet to XML format
  • and finally write XML records in batches of 10 to the output file tweets.xml

At the end of execution, you get a report with statistics and metrics about the job run (Execution time, number of errors, etc).

All the boilerplate code of resources I/O, iterating through the data source, filtering and parsing records, mapping data to the domain object Tweet, writing output and reporting is handled by Easy Batch. Your code becomes declarative, intuitive, easy to read, understand, test and maintain.

Presentations, articles & blog posts

Current versions

Stable:

The current stable version is v5.1.0 | documentation | tutorials | javadoc

Development:

The current development version is 5.2.0-SNAPSHOT Build Status Build status

If you want to import a snapshot version, you need to use the following repository:

<repository>
    <id>ossrh</id>
    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>

Contribution

You are welcome to contribute to the project with pull requests on GitHub.

If you find a bug or want to request a feature, please use the issue tracker.

For any further question, you can use the forum or the gitter channel.

Awesome contributors

Thank you all for your contributions!

Acknowledgments

JetBrains YourKit Travis CI
IntelliJ IDEA YourKit Java Profiler Travis CI
Many thanks to JetBrains for providing a free license of IntelliJ IDEA to kindly support the development of Easy Batch Many thanks to YourKit, LLC for providing a free license of YourKit Java Profiler to kindly support the development of Easy Batch. Many thanks to Travis CI for providing a free continuous integration service for open source projects.

License

Easy Batch is released under the MIT license.

The MIT License (MIT)

Copyright (c) 2017 Mahmoud Ben Hassine (mahmoud.benhassine@icloud.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.