Spring Batch is an open-source project for batch processing (execution of a series of jobs).

A Batch Job is composed of one or more Steps. Each step consists of a Tasklet (explicitly or implicitly using ItemReader and ItemWriter). Each level (Job, Step and Tasklet) has an execute method.

Step execution can be parallelized using multiple threads. Remote Chunking (processing of part of Step, chunk on a remote JVM) can also be done with the help of JMS. Different steps in a job can be executed in separate threads use-case permitting.

From an APM perspective, tracking batch workloads at the Job level brings limited value, since batch Jobs are usually very long-running and an alert that the Job overran would come too late for remedial action to be taken. For this reason, the AppDynamics Business Transactions should be placed at the Tasklet level, meaning one batch Job will be composed of many Tasklet Business Transaction executions.

You can turn off spring batch instrumentation using the spring-batch-enabled node property.

Alerting on the response times of these Business transactions allows AppDynamics users to:

  • Proactively detect that a Batch Job is progressing more slowly than usual, and thus predict if it will overrun any batch window
  • Troubleshoot the root-cause of any unusual slow-downs in the progress of batch jobs in order that the issue can be remediated before the Job overruns

To achieve this, from Java Agent 4.5:

  • Creates BTs at Tasklet.execute, named after the Job, Step, and Tasklet

  • Correlates chunks across thread boundaries or process boundaries through JMS