Rajesh2389
Rajesh2389

Reputation: 379

How to Limit the Job Execution Ids Listings in Spring-data-flow-server's Task Execution Details page?

I have a set of Spring boot batch jobs, which I have deployed in Spring cloud data flow serve. I'm using local server configuration. But I also want the Scheduling option for each jobs inside my application. So as mentioned in document Scheduling for Local Config for Scheduling jobs using local configuration, I use rest services along with @Scheduled annotation to kick start the job or otherwise knows as task in SCDF.

These scheduled jobs are supposed to run at 15 minutes intervals for several days. And there are 10 jobs. So what's happening when I launch the job using REst API is,

//Job Config
    @Configuration
    @EnableBatchProcessing
    @EnableTask
    public class Job1Loader {
    @Bean
        public Job loadJob1()
        {
            return jobBuilderFactory().get("JOb1Loader")
                .incrementer(new RunIdIncrementer())
                .flow(job01_step01())
                .end()
                .build();;//return job
    }

Rest Controller

@RestController
public class JobLauncherController {

    Logger logger = LoggerFactory.getLogger(JobLauncherController.class);

    @Autowired
    JobLauncher jobLauncher;

    @Autowired
    @Qualifier(value = "loadJob1")
    Job job1;

    @Scheduled(cron ="0 */2 * * * ?")
    @RequestMapping("/LaunchJob1")
    public String LaunchJob1() throws Exception
    {
        logger.info("Executing LaunchJob1");
        JobParameters jobParameters = new JobParametersBuilder().addLong("time", System.currentTimeMillis())
                .toJobParameters();
        jobLauncher.run(job1, jobParameters);

        return "Job has been launched";
    }
}

So my question is this. How to limit the number of job id's listed in "Task Execution Details" page to minimum of 10 job id's. Or is there a possibility of introducing a scroll bar when certain thershold reaches for Job id count. Attached the screenshot for better unedrstanding.

Job Execution Ids

Upvotes: 0

Views: 172

Answers (1)

Ilayaperumal Gopinathan
Ilayaperumal Gopinathan

Reputation: 4179

Currently, the REST API for Task execution response which includes the JobExecutionIds doesn't have such filtering options. What you mention above is more than a feature request than an issue :-)

Would you mind creating a feature request in here and of course, you are welcome to contribute by providing a Pull Request with the changes.

Upvotes: 1

Related Questions