Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-7661

Provide mechanism to persist error message/s in Sling Jobs API

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Not A Problem
    • None
    • None
    • API
    • None

    Description

      The sling Jobs API provides a JobConsumer interface: org.apache.sling.event.jobs.consumer.JobConsumer" and Job interface: org.apache.sling.event.jobs.Job.

      Currently, when a JobConsumer fails, it's supposed to return a JobResult.CANCEL, but there is no way to set an error message.

      Looking at the JCR, we see that such (failed/canceled) jobs are saved to /var/eventing/jobs/cancelled/ with a property "slingevent:finishedState=ERROR".

      It would be beneficial to add a method to the Job interface to set an error String or List<String> for multiple errors (to save stacktrace perhaps). That way if a job fails we can debug the issue.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lnra54 Leonardo Rodriguez
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: