You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Andrew Khoury (Jira)" <ji...@apache.org> on 2023/05/02 22:40:00 UTC

[jira] [Commented] (SLING-11831) Allow setting job properties for custom job state

    [ https://issues.apache.org/jira/browse/SLING-11831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17718747#comment-17718747 ] 

Andrew Khoury commented on SLING-11831:
---------------------------------------

Another PR for the addition of @NotNull annotations https://github.com/apache/sling-org-apache-sling-event-api/pull/4

> Allow setting job properties for custom job state
> -------------------------------------------------
>
>                 Key: SLING-11831
>                 URL: https://issues.apache.org/jira/browse/SLING-11831
>             Project: Sling
>          Issue Type: Improvement
>          Components: Event
>    Affects Versions: Event 4.3.8
>            Reporter: Andrew Khoury
>            Assignee: Dan Klco
>            Priority: Major
>
> The [JobExecutionContext|https://github.com/apache/sling-org-apache-sling-event-api/blob/d151fdf0da58ed0dbf18002788f8965b0ebcef84/src/main/java/org/apache/sling/event/jobs/consumer/JobExecutionContext.java#L28] currently allows updating Job progress info and the progress log but it doesn't allow storing of custom properties.  The reason we would want to support custom properties is to allow storing resume information.
> For example, let's say we have a job where we are moving multiple resources around in a clustered environment with many sling instances pointing to the same JCR repository (for example Oak MongoMK).  If the instance that is running the move job crashes in the middle of the job execution we would want some information stored so the job can be resumed on another node.
> To solve this issue, we can introduce a setProperty method to the [JobExecutionContext.|https://github.com/apache/sling-org-apache-sling-event-api/blob/d151fdf0da58ed0dbf18002788f8965b0ebcef84/src/main/java/org/apache/sling/event/jobs/consumer/JobExecutionContext.java#L28]
> This method would allow us to save some state information for use in case the job is resumed on another node.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)