Configuring a Batch Thread Pool

This chapter describes configuration for a thread pool that execute a job defined in Jakarta Batch.

1. Overview

A thread pool can be configured in the Web (or EJB), or in the application whose batch-thread-pool option contains thread pool specifications and allows threads to be used regardless of priority.

If thread pools are configured in both Web DD and application DD, or in both EJB DD and application DD, they follow the configuration in either Web DD or EJB DD.

2. Configuring Batch Thread Pools

If batch-thread-pool is not specified in DD, the server uses the default thread pool to execute a job.

The following describes the thread pool settings.

Item Description

min

Minimum number of threads for a thread pool to execute a job.

(Default value: 0)

max

Maximum number of threads for a thread pool to execute a job.

(Default value: 0)

keep-alive-time

Amount of time after which idle threads are discarded when the number of threads are between the values set for min and max.

No thread is discarded if there is none in the thread pool. (Default value: 60000, Unit: ms)

queue-size

Size of the queue of pending requests defined in the thread pool.

(Default value: 4096)

Tuning the thread pool depends on the priority of each DD statement. This section describes each DD configuration.

2.1. Configuring Thread Pools in Component DD

A component refers to any one of Jakarta Batch components such as a servlet or an EJB, and it has the highest priority in case there are many thread pool configurations in the server. The thread pool can be configured in jeus-web-dd.xml or jeus-ejb-dd.xml.

The following is an example of configuring batch-thread-pool in /WEB-INF/jeus-web-dd.xml.

Configuring Thread Pools in Component DD: <jeus-web-dd.xml>
<jeus-web-dd xmlns="http://www.tmaxsoft.com/xml/ns/jeus" version="8.0">
    <batch-thread-pool>
        <min>10</min>
        <max>20</max>
        <keep-alive-time>60000</keep-alive-time>
        <queue-size>4096</queue-size>
    </batch-thread-pool>
</jeus-web-dd>

The following is an example of configuring batch-thread-pool in /META-INF/jeus-ejb-dd.xml.

Configuring Thread Pools in Component DD: <jeus-ejb-dd.xml>
<jeus-ejb-dd xmlns="http://www.tmaxsoft.com/xml/ns/jeus" version="8.0">
    <batch-thread-pool>
        <min>10</min>
        <max>20</max>
        <keep-alive-time>60000</keep-alive-time>
        <queue-size>4096</queue-size>
    </batch-thread-pool>
</jeus-ejb-dd>

2.2. Configuring Thread Pools in Application DD

The following is an example of configuring batch-thread-pool in /META-INF/jeus-application-dd.xml.

Configuring Thread Pools in Application DD: <jeus-application-dd.xml>
<application xmlns="http://www.tmaxsoft.com/xml/ns/jeus" version="8.0">
    <batch-thread-pool>
        <min>10</min>
        <max>20</max>
        <keep-alive-time>60000</keep-alive-time>
        <queue-size>4096</queue-size>
    </batch-thread-pool>
</application>

3. Logging

Jakarta Batch does not use the JEUS logger but a Java logger, which needs configuration. For information about configuring a Java logger, refer to Property Configuration in JEUS Server Guide.

The level of the logger must be configured according to the com.ibm.jbatch.