spring-projects / spring-projects/spring-boot

Add execution information in Quartz job detail

Open
#43,226 2 comments 0 reactions 1 assignee View on GitHub

@snicoll is already working on this.

Since Nov 20, 2024.

type: enhancement
Dominant language
Java
Stars
81.5k
Forks
42.7k
Avg merge
2d 4h
Merged PRs (30d)
65

Description

Reviewing #43086 and brainstorming with @wilkinsona we believe that the detail of a job should specify whether it's running or not and additional information if it is.

Doing so will help with triggering a new execution on demand.

The detail of a test job is currently as follows:

{
    "className": "com.example.demoquartz.DemoQuartzApplication$TestJob",
    "data": {},
    "durable": true,
    "group": "DEFAULT",
    "name": "testJob",
    "requestRecovery": false,
    "triggers": [
            "group": "DEFAULT",
            "name": "testJobTrigger",
            "nextFireTime": "2024-11-20T10:26:43.791+00:00",
            "previousFireTime": "2024-11-20T10:25:43.791+00:00",
            "priority": 5
    ]
}

For a Job who's currently running, we'd like the description to improve as follows:

{
  "className": "com.example.demoquartz.DemoQuartzApplication$TestJob",
  "data": {},
  "durable": true,
  "group": "DEFAULT",
  "name": "testJob",
  "requestRecovery": false,
  "running": true,
  "triggers": [
    {
      "executions": {
        "previous": "2024-11-20T10:25:43.791+00:00",
        "next": "2024-11-20T10:26:43.791+00:00",
        "current": {
          "fireTime": "2024-11-20T10:25:43.794+00:00",
          "recovering": false,
          "refireCount": 0
        }
      },
      "group": "DEFAULT",
      "name": "testJobTrigger",
      "priority": 5
    }
  ]
}

If the job is not running, it would be:

{
  "className": "com.example.demoquartz.DemoQuartzApplication$TestJob",
  "data": {},
  "durable": true,
  "group": "DEFAULT",
  "name": "testJob",
  "requestRecovery": false,
  "running": false,
  "triggers": [
    {
      "executions": {
        "previous": "2024-11-20T10:25:43.791+00:00",
        "next": "2024-11-20T10:26:43.791+00:00",
      },
      "group": "DEFAULT",
      "name": "testJobTrigger",
      "priority": 5
    }
  ]
}

For backward compatible reason, the nextFireTime and previousFireTime should still be present but we'll stop documenting them.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.