Using Batch API with JBoss EAP 6

Today I’m going to demonstrate how to run the Batch API on JBoss EAP 6. As you probably know, Jboss EAP 6 (and AS 7) features the Java EE 6 API which does not include the Batch API, that is part of Java EE 7.

In order to run the Batch API on JBoss EAP 6 we need to patch the installation of the application server by downloading the backport of Batch API subsystem to available at:

  • Download the latest dist (
  • Unzip it under the modules folder of JBoss EAP 6
  • Modify the modules/system/layers/base/javaee/api/main/module.xml:

Include the following dependency:

   <module name="javax.batch.api" export="true"/>

We need to create a configuration ad hoc (or simply change one of your existing configurations):

Create a copy of your configuration file (e.g. standalone.xml):

cp standalone.xml standalone-batch.xml

Now add the batch extension at the top of it:



    <extension module="org.wildfly.extension.batch"/>


Next, within your profile (I’ve added it at the beginning) add the batch subsystem:

<subsystem xmlns="urn:jboss:domain:batch:1.0">
		<jdbc jndi-name="java:jboss/datasources/ExampleDS"/>
		<max-threads count="10"/>
		<keepalive-time time="30" unit="seconds"/>

Now start the application server: -c standalone-batch.xml

Now connect to the CLI and verify that the subsystem batch is available:

[standalone@localhost:9999 /] /subsystem=batch:read-resource
    "outcome" => "success",
    "result" => {
        "job-repository-type" => "jdbc",
        "job-repository" => {"jdbc" => undefined},
        "thread-factory" => undefined,
        "thread-pool" => {"batch" => undefined}

Congratulations! You have successfully patched EAP 6 to run the Batch API!