Spring Package: how to track current work tasks and show progress on jsp page

I want to know how to monitor the status of my currently running batch jobs. My tasks basically process the folder with some default steps, so I want to show the progress to the user step by step. I use Tasklets and the Database Repository . Extending the sample code to achieve this would be more useful.
Thank.

+2
source share
3 answers

If you want to develop your own application / monitor web page, you can look at the interface JobExploreror JobOperator. It provides you methods for getting JobExecutions, and in JobExecutions you can get StepExecutions. All this gives you job status and individual steps inside.


Change response for comment:

Spring Batch. . . , . ( , , - , Spring Batch), tasklet Spring . ( : , execute(), FINISHED , , ..).

, , , JobExplorer JobOperator, → → .

+4

spring batch admin.

Spring

: . - (, localhost: 8080/ spring -batch-admin-sample) .

, .

+5

Spring Batch version 4.2 comes with batch monitoring and micrometer-based metrics collection. You can try to use the same. The following table lists some metrics.Spring batch metrics

Spring Batch also allows you to create your own metrics. You can find more information here https://docs.spring.io/spring-batch/4.2.x/reference/html/monitoring-and-metrics.html#custom-metrics

0
source

All Articles