-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Added support to Quartz Plugins And Listeners #10967
Conversation
Well, there is no log at the failed pipe (Quarkus CI / JDK Java 14 JVM Tests (pull_request)). Should I send another commit to it to retry? |
Hi @marcelorubim, thanks for your contribution! Your PR should include at least some basic tests (you can follow the tests in https://github.com/quarkusio/quarkus/tree/master/extensions/quartz/deployment/src/test/java/io/quarkus/quartz/test). Furthermore, your branch should be squashed down to a single buildable commit. And finally, the issue is still being discussed so pls keep an eye on the comments... |
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) | ||
.addClasses(Jobs.class) | ||
.addAsResource(new StringAsset( | ||
"quarkus.quartz.plugin.shutdownhook.class=org.quartz.plugins.management.ShutdownHookPlugin\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not a good plugin to test. We do shutdown the quartz scheduler when a quarkus app/test stops ;-).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is because if I register an invalid plugin, the Quartz won't start. The test can check if parsing the config to Quartz properties is working fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR @marcelorubim I'd suggest we test we add an integration test too. Things like class registration for reflection would most likely be needed and having an integration test https://github.com/quarkusio/quarkus/tree/master/integration-tests/quartz would most likely show this up and avoid future regressions.
Added this on application.properties on the integration test:
And this to QuartzProcessor. config.triggerListeners.values().forEach((value) -> {
reflectiveClasses.add(new ReflectiveClassBuildItem(true, false, value.clazz));
});
config.jobListeners.values().forEach((value) -> {
reflectiveClasses.add(new ReflectiveClassBuildItem(true, false, value.clazz));
});
config.plugins.values().forEach((value) -> {
reflectiveClasses.add(new ReflectiveClassBuildItem(true, false, value.clazz));
}); Now seems to works just fine on native mode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcelorubim thank you for the wonderful work. It is looking great, I like your configuration proposal much better than the plain Map<String, Map<String, String>>
.
I've added comments, and once they are addressed this is good to merge.
extensions/quartz/deployment/src/main/java/io/quarkus/quartz/deployment/QuartzProcessor.java
Outdated
Show resolved
Hide resolved
extensions/quartz/runtime/src/main/java/io/quarkus/quartz/runtime/QuartzScheduler.java
Outdated
Show resolved
Hide resolved
extensions/quartz/deployment/src/main/java/io/quarkus/quartz/deployment/QuartzProcessor.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @marcelorubim. All good for me.
@mkouba do you want to have a look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good. I've added few minor docs comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor gripe: any chance you could adjust the commit message? git commit --amend
should allow you to do that and then force push.
Thanks!
Thanks! Let's wait for CI and merge. |
Merged, thanks! |
Thank you @marcelorubim for the PR. |
Added support to Quartz Plugins And Listeners, as described on issue #10962
Fix #10962