Giter Site home page Giter Site logo

jsr352's Introduction

thumbnail

JBeret is an implementation of JSR 352 (Batch Applications for the Java Platform). It is also included in WildFly, the new and improved JBoss Application Server to provide portable batch processing support in Java EE environment.

####Build JBeret To build and run default set of tests:

mvn install

Some tests require additional steps and thus are not included in the default run. For instance, MongoDB-related tests need to start MongoDB first. To build and run all tests:

# start MongoDB database
mongod

# build JBeret, activate allTests maven profile to run all tests
mvn install -DallTests

Some tests involves very large data set (e.g., over 1 million rows of CSV or Excel data), and may cause memory errors in some machines:

OutOfMemoryError: unable to create new native thread

Increase ulimit to avoid such errors. For example,

ulimit -u 2048add

####Sub-modules:

####3rd-party & Community Extensions:

####Project Resources:

####Batch sample & test applications:

  • https://github.com/chengfang/wildfly-samples/tree/master/jberet, web apps that demonstrate the following:
    • JsonItemReader, JsonItemWriter
    • CsvItemReader, CsvItemWriter
    • XmlItemReader, XmlItemWriter
    • MongoItemReader, MongoItemWriter
    • JNDI lookup of Jackson JsonFactory, MappingJsonFactory & XmlFactory in WildFly for batch reader and writer
    • JNDI lookup of MongoClient in WildFly
    • job xml files showing the use of various reader/writer configuration properties
    • jberet-support module can be installed in WildFly and referenced by multiple apps via either MANIFEST.MF or jboss-deployment-structure.xml
  • https://github.com/jberet/jsr352/tree/master/jberet-support/src/test
    • comprehensive tests for implemented batch readers and writers
  • https://github.com/jberet/jsr352/tree/master/test-apps
    • test apps running in Java SE environment to verify core batch requirements
    • test apps running in Java SE environment to verify additional JBeret features (inheritance, scripting support, infinispan job repository, etc)

org.jberet artifacts may be retrieved from Maven Central or JBoss Public Repository

<repositories>
    <repository>
        <id>jboss-public-repository-group</id>
        <name>JBoss Public Repository Group</name>
        <url>http://repository.jboss.org/nexus/content/groups/public/</url>
    </repository>
</repositories>
...
<dependencies>
    <dependency>
        <groupId>org.jboss.spec.javax.batch</groupId>
        <artifactId>jboss-batch-api_1.0_spec</artifactId>
        <version>1.0.0.Final</version>
    </dependency>
    <dependency>
        <groupId>org.jberet</groupId>
        <artifactId>jberet-core</artifactId>
        <version>1.0.2.Final</version> <!-- replace it with the desired version -->
    </dependency>
    <dependency>
        <groupId>org.jberet</groupId>
        <artifactId>jberet-support</artifactId>
        <version>1.0.2.Final</version> <!-- replace it with the desired version -->
    </dependency>

####Batch application dependencies #####Minimal application dependencies: org.jboss.spec.javax.batch jboss-batch-api_1.0_spec javax.inject javax.inject javax.enterprise cdi-api org.jboss.spec.javax.transaction jboss-transaction-api_1.2_spec org.jberet jberet-core org.jboss.marshalling jboss-marshalling org.jboss.logging jboss-logging org.jboss.weld weld-core org.wildfly.security wildfly-security-manager com.google.guava guava

A note on webapp or Java EE application packaging: Java EE API jars (batch-api, cdi-api, javax.inject, transaction-api) are already available in the appserver, and should not be included in WAR, JAR, or EAR files. Their maven dependency scope should be set to provided. In addition, if the application is deployed to JBoss EAP or WildFly, almost all of the above dependencies are already available as JBoss modules, and should not be duplicated in application package.

#####The following is also required for Java SE batch applications (h2 can be omitted when using in-memory batch job repository): org.jberet jberet-se org.jboss.weld.se weld-se com.h2database h2

#####Optional application dependencies depending on application usage: com.h2database h2

     <!-- infinispan and jgroups jars, when infinispan job repository is used.
          Additional infinispan cachestore jars (e.g., infinispan-cachestore-jdbc, infinispan-cachestore-mongodb,
          infinispan-cachestore-leveldb, infinispan-cachestore-rest, infinispan-cachestore-cassandra, etc) may be
          needed if such a cachestore is used. -->
     <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-core</artifactId>
     </dependency>
     <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-commons</artifactId>
     </dependency>
     <dependency>
         <groupId>org.jgroups</groupId>
         <artifactId>jgroups</artifactId>
     </dependency>

     <!-- MongoDB jars, when MongoDB job repository is used -->
     <dependency>
         <groupId>org.mongodb</groupId>
         <artifactId>mongo-java-driver</artifactId>
         <version>${version.org.mongodb.mongo-java-driver}</version>
         <scope>provided</scope>
     </dependency>

    <!-- For Weld 2.2.2.Final or later, Jandex is required for annotation processing -->
    <dependency>
        <groupId>org.jboss</groupId>
        <artifactId>jandex</artifactId>
    </dependency>
    
    <!-- replace Java built-in StAX provider with aalto-xml or woodstox
         (woodstox dependencies not shown here)
    -->
    <dependency>
        <groupId>com.fasterxml</groupId>
        <artifactId>aalto-xml</artifactId>
    </dependency>
    <dependency>
        <groupId>org.codehaus.woodstox</groupId>
        <artifactId>stax2-api</artifactId>
    </dependency>
    
    <!-- jberet-support includes common reusable batch ItemReader & ItemWriter classes for
         various data types such as CSV, XML, JSON, Fixed length, Excel, MongoDB, JDBC, JMS, HornetQ, etc.
         The application should further provide appropriate transitive dependencies from 
         jberet-support, depending on its usage.
    -->
    <dependency>
        <groupId>org.jberet</groupId>
        <artifactId>jberet-support</artifactId>
    </dependency>

jsr352's People

Contributors

chengfang avatar jamezp avatar nuzayats avatar mobe91 avatar jmartisk avatar elguardian avatar radcortez avatar stuartwdouglas avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.