Table of Contents
This chapter describes configuration for a thread pool that execute a job defined in JBatch.
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.
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: 0) |
max | Maximum number of threads for a thread pool to execute a job. (Default: 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: 60,000; Unit: ms) |
queue-size | Size of the queue of pending requests defined in the thread pool. (Default: 4096) |
Tuning the thread pool depends on the priority of each DD statement. This section describes each DD configuration.
A component refers to any one of JBatch 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.
[Example 2.1] 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>20</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.
[Example 2.2] 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>20</keep-alive-time> <queue-size>4096</queue-size> </batch-thread-pool> </jeus-ejb-dd>
The following is an example of configuring batch-thread-pool in /META-INF/jeus-application-dd.xml.
[Example 2.3] 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>20</keep-alive-time> <queue-size>4096</queue-size> </batch-thread-pool> </application>
JBatch does not use the JEUS logger but a Java logger, which needs configuration. For information about configuring a Java logger, see JEUS Server Guide. "8.3. Logging Configuration".
The level of the logger should be configured according to the com.ibm.jbatch.