Develop a parallel job management application
We can build a transactional batch application as a job and divide the job into subordinate jobs so that the subordinate jobs can run independently and in parallel. Use parallel job manager to submit and manage the transactional batch jobs.
For transitioning users: Parallel job management applications built for prior versions of WebSphere Batch can run as is on WebSphere Application Server v8.5. However, follow the same procedure as having two xJCl files, an xd.spi.properties file, and a shared library configured for two SPI implementations. When using the application as is, do not do the steps in the following procedure.trns
For transitioning users: We can migrate parallel job management applications to WebSphere Application Server v8.5. Add the API implementation classes to the application EAR. Reauthor the xJCL as described in the following procedure.trns
You develop subordinate jobs for the job so that the subordinate jobs can run independently and in parallel. First develop the criteria that breaks jobs into subordinate jobs. Then build a simple batch application and make the pieces of the application parallel. Finally, create the xJCl for the subordinate jobs so that in another procedure we can deploy the application following another procedure.
- Develop the criteria that breaks jobs into subordinate jobs.
For example, divide jobs into subordinate jobs based on bank branches, with the subordinate job for each branch based on the location of the branch. For a given bank branch, have the subordinate job compute the balance of each account at the end of the day based on the daily transactions for each account.
- Build a simple batch application to process the information as a job.
- Make the pieces of the application parallel.
Implement the parameter API to divide the job for the batch application into multiple subordinate jobs.
- Optional: Collect information about a subordinate job running.
Use the SubJobCollector API to collect the information.
- Optional: Analyze information collected about the subordinate job.
Use the SubJobAnalyzer API to analyze the information.
- Create the xJCL.
Start with xJCL from the job created for the simple batch application.
- Specify the run element as a child of the job element.
- Set the instances attribute on the run element to multiple.
- Set the JVM (JVM) attribute on the run element to single or multiple.
Use the single attribute to run all subordinate jobs in the same JVM. Use the multiple attribute to run the subordinate jobs on any valid JVM.
<run instances="multiple" jvm="multiple">
We can specify the run element as a child of a step. In this situation, the step is run as a parallel job. The contents of the step xJCL are used to generate a one step subordinate job xJCL.
- Specify one prop element as a child of the run element for each PJM API.
- Specify the PJM API on the name attribute.
The following APIs are valid for the PJM:
- com.ibm.websphere.batch.parallel.parameterizer
- com.ibm.websphere.batch.parallel.synchronization
- com.ibm.websphere.batch.parallel.subjobanalyzer
- com.ibm.websphere.batch.parallel.subjobcollector
- Set the value attribute to a name for the API.
- Include a prop element to specify the subordinate job name.
- Set the name attribute to com.ibm.wsspi.batch.parallel.subjob.name.
- Set the value attribute to the name of the job.
- Optional: Include a prop element to indicate the job count.
- Set the name attribute to parallel.jobcount.
- Set the value attribute to a value for the job count.
- Specify any other job-level properties.
<run instances="multiple" jvm="multiple"> <props> <prop name="com.ibm.websphere.batch.parallel.parameterizer" value="com.ibm.websphere.samples.spi.MailerParameterizer"/> <prop name="com.ibm.websphere.batch.parallel.synchronization" value="com.ibm.websphere.samples.spi.MailerTXSynchronization"/> <prop name="com.ibm.websphere.batch.parallel.subjobanalyzer" value="com.ibm.websphere.samples.spi.MailerSubJobAnalyzer"/> <prop name="com.ibm.websphere.batch.parallel.subjobcollector" value="com.ibm.websphere.samples.spi.MailerSubJobCollector"/> <prop name="com.ibm.wsspi.batch.parallel.subjob.name" value="MailerSampleSubJob" /> <!-- The count of parallel sub jobs to be submitted --> <prop name="parallel.jobcount" value="3" /> </props> </run>
- Include the same three step level properties in each step in the xJCL.
<prop name="com.ibm.wsspi.batch.parallel.jobname" value="${parallel.jobname}" /> <prop name="com.ibm.wsspi.batch.parallel.logicalTXID" value="${logicalTXID}" /> <prop name="com.ibm.wsspi.batch.parallel.jobmanager" value="${parallel.jobmanager}" />
Results
You have created a job with subordinate jobs that can run independently and in parallel.
What to do next
Deploy the application as you would other batch applications.
Subtopics
- Parallel job manager (PJM)
The parallel job manager (PJM) provides a facility and framework for submitting and managing transactional batch jobs that run as a coordinated collection of independent parallel subordinate jobs.
- Parallel job manager APIs
Parallel job manager (PJM) SPIs in previous releases are now APIs. They are packaged as part of an application.
- Other considerations for the parallel job manager
There are other considerations that help you understand how to optimally use the parallel job manager.
Related tasks
Develop a simple compute-intensive application Develop a simple transactional batch application Deploy batch applications
Samples, v8.5 information center