Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Quartz JobDataMap to persist data between runs when using @Scheduled #26062

Open
famod opened this issue Jun 10, 2022 · 3 comments
Open
Labels

Comments

@famod
Copy link
Member

famod commented Jun 10, 2022

Description

Quartz provides the so called JobDataMap which you can add mappings to that are persisted so that the next execution can read the previously persisted data. It is available via JobExecutionContext, but that context is not exposed when using @Scheduled (non-programmatic, annotation-driven approach).
Furthermore, the InvokerJob that is registered when using @Scheduled is neither a StatefulJob nor is it annotated with @PersistJobDataAfterExecution, so data won't be persisted.

The goal is to extend quarkus-quartz to opt into persitence and expose the context/map, with the annotation-driven approach.

Implementation ideas

Some ideas were discussed in #25987.

@famod famod added the kind/enhancement New feature or request label Jun 10, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Jun 10, 2022

/cc @machi1990, @mkouba

@famod
Copy link
Member Author

famod commented Jun 22, 2022

One gotcha (or thing to adjust) is that triggering a job in dev ui creates a DevModeScheduledExecution, not a QuartzScheduledExecution.

@mkouba
Copy link
Contributor

mkouba commented Jan 30, 2024

For the record - you should be able to fall back to the Quartz API, annotate the job class with @PersistJobDataAfterExecution and @DisallowConcurrentExecution and schedule the job programmatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants