spring-bootspring-batchbatch-processingspring-batch-job-monitoring

Get status of running worker nodes at regular intervals in spring batch deployer partition handler


I am using deployer partition handler for remote partitioning in spring batch. I want to get the status of each worker node at regular intervals and display it to the user. ( Like heartbeats ). Is there any approach to achieve this ?


Solution

  • This depends on what your workers are doing (simple tasklet or chunk-oriented one) and how they are reporting their progress. Typically, workers share the same job repository as the manager step that launched them, so you should be able to track their StepExecution updates (readCount, writeCount, etc) on that repository using the JobExplorer API.

    If you deploy your job on Spring Cloud DataFlow, you can use the Step execution progress endpoint to track the progress of workers.