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

Quartz extension issue with parameters batchTriggerAcquisitionMaxCount and batchTriggerAcquisitionFireAheadTimeWindow #38356

Closed
sebdet opened this issue Jan 23, 2024 · 3 comments · Fixed by #38470
Assignees
Labels
area/scheduler kind/bug Something isn't working
Milestone

Comments

@sebdet
Copy link

sebdet commented Jan 23, 2024

Describe the bug

These parameters are not taken into account by the quartz extension (in version 2.X and version 3.X), the values are always set to 1 for batchTriggerAcquisitionMaxCount and 0 for batchTriggerAcquisitionFireAheadTimeWindow, even if I put some values in the application.properties or if I define env var.
I have investigated the code and I have debugged the code, it seems the problem is located here:
https://github.com/quarkusio/quarkus/blob/3.6/extensions/quartz/runtime/src/main/java/io/quarkus/quartz/runtime/QuartzSchedulerImpl.java line 517 & 518

        props.put(StdSchedulerFactory.PROP_SCHED_BATCH_TIME_WINDOW, runtimeConfig.batchTriggerAcquisitionFireAheadTimeWindow);
        props.put(StdSchedulerFactory.PROP_SCHED_MAX_BATCH_SIZE, runtimeConfig.batchTriggerAcquisitionMaxCount);

This must be replaced by:

        props.put(StdSchedulerFactory.PROP_SCHED_BATCH_TIME_WINDOW, ""+runtimeConfig.batchTriggerAcquisitionFireAheadTimeWindow);
        props.put(StdSchedulerFactory.PROP_SCHED_MAX_BATCH_SIZE, ""+runtimeConfig.batchTriggerAcquisitionMaxCount);

So that the values in well defined in String in the properties object and the QUartz scheduler is able to convert them to int.
Thank you

Expected behavior

These parameters batchTriggerAcquisitionMaxCount and batchTriggerAcquisitionFireAheadTimeWindow, when defined in the application.properties or defined in the env var must be taken into account and propagated to QUartz.

Actual behavior

These parameters batchTriggerAcquisitionMaxCount and batchTriggerAcquisitionFireAheadTimeWindow are obviously not set in QUartz, instead they are respectively defined to 1 and 0.

How to Reproduce?

Just set quarkus.quartz.batch-trigger-acquisition-fire-ahead-time-window or quarkus.quartz.batch-trigger-acquisition-max-count to a value in application.properties

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@sebdet sebdet added the kind/bug Something isn't working label Jan 23, 2024
@quarkus-bot
Copy link

quarkus-bot bot commented Jan 23, 2024

/cc @machi1990 (quartz), @mkouba (quartz)

@mkouba
Copy link
Contributor

mkouba commented Jan 24, 2024

@sebdet would you care to send a pull request?

@mkouba mkouba self-assigned this Jan 30, 2024
@mkouba
Copy link
Contributor

mkouba commented Jan 30, 2024

@sebdet would you care to send a pull request?

Nevermind, I'll send a PR shortly..

mkouba added a commit to mkouba/quarkus that referenced this issue Jan 30, 2024
- i.e. batchTriggerAcquisitionMaxCount and
batchTriggerAcquisitionFireAheadTimeWindow
- fixes quarkusio#38356
@quarkus-bot quarkus-bot bot added this to the 3.9 - main milestone Jan 30, 2024
@gsmet gsmet modified the milestones: 3.9 - main, 3.7.1 Jan 30, 2024
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jan 30, 2024
- i.e. batchTriggerAcquisitionMaxCount and
batchTriggerAcquisitionFireAheadTimeWindow
- fixes quarkusio#38356

(cherry picked from commit b7d4109)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/scheduler kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants