-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
add scheduler configuration and add support for clustered jobs #3783
Conversation
integration-tests/main/src/main/resources/META-INF/persistence.xml
Outdated
Show resolved
Hide resolved
bc49474
to
11407ee
Compare
Some tests seem to be failing. Perhaps you would like to take a look @machi1990 ? |
I know @mkouba should have things to say about this :) |
Thank you for your help ! Hope to see this released soon. |
I have a native test failure:
@dmlloyd is this related to #2656? I am not sure what's the best way to workaround that since GraalVM does not support Serialization yet? see oracle/graal#460 @bobmcwhirter @dmlloyd @cstancu Any ideas of a workaround you might have will be appreciated. |
I have pushed new changes that de-activates |
Hey @machi1990, this looks like a great contribution. However, I think that we'll need to create a separate Quartz extension because the Scheduler extension API/config should not be bound to a Quartz-specific config/API. In fact, we should probably define an SPI in the scheduler extension and implement this SPI in the Quartz extension. One problem with this approach could be that a user would have to declare two dependencies instead of one ( @emmanuelbernard @dmlloyd WDYT? |
I think the core question we should open up in quarkus-dev is do we want to keep a simple scheduler API which would not use Quarz (or abstracted of at least) to keep things simple, offer build time improvements possibilities etc |
Also, if Quartz's database capabilities can't work (yet) on native, does it make sense to have it exposed? |
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.
I ahve strong reservations for two main reasons:
- no support for native image
- configuration do leak the fact that it's a blocking implementation and specific to Quartz
An alternative if people really need it and are ok with JVM only would be to fork that extension and host it in a different repo. We wouldn't having in the Quarkus platform but you could reference it in your pom like this one and use it.
Defaults to: `DefaultQuartzScheduler` + | ||
|
||
|
||
`quarkus.scheduler.state-store.misfire-threshold`:: The number of duration by which a trigger must have missed its next-fire-time, in order for it to be considered "misfired" and thus have its misfire instruction applied. |
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.
I could see that one being a functional setting. Is that very useful in practice ? Do we need to expose it ?
Defaults to: `1m` + | ||
|
||
|
||
`quarkus.scheduler.state-store.cluster-checking-interval`:: The frequency at which this instance "checks-in" with the other instances of the cluster .This affects the rate of detecting failed instances. |
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 one goes a bit into the weeds of implementation details. Do we have to have that option expose?
Type: `java.lang.Boolean` + | ||
|
||
|
||
`quarkus.scheduler.state-store.driver-delegate-class`:: The JDBC driver delegate class. This is not required if the <<state-store-type, state store>> is `in-memory`. |
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.
Not fan of that, We must pass the quarkus.database name we want to use, not define a JDBC driver and all. That would be the quarkus unified way.
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.
I take that back, what is that delegate class needed? What would people put as value in practice?
Possible values can be obtained from https://github.com/quartz-scheduler/quartz/tree/master/quartz-core/src/main/java/org/quartz/impl/jdbcjobstore[quartz-scheduler JDBC stores delegate] | ||
+ | ||
Type: `java.lang.String` + | ||
Defaults to: `org.quartz.impl.jdbcjobstore.StdJDBCDelegate` + |
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.
defaulting to Quartz means you say your engine is Quarkz
- If set to `in-memory`, the scheduler will use the `org.quartz.simpl.RAMJobStore` job store class | ||
- If set to `jdbc`, the scheduler will use the `org.quartz.impl.jdbcjobstore.JobStoreTX` job store class. | ||
When using this option make sure that you have the link:datasource-guide.html[agroal datasource configured] and that <<creating-scheduling-job, scheduling tables>> exists. | ||
This store type is not supported in Native Image because of https://github.com/oracle/graal/issues/460[unsupported Object serialization]. |
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.
Hum, now that's a line we never crossed. We have our features supported in native, all of them. To me that's a blocker. If people really need this feature we could host a fork of that extension that only work with JVM and one can reference it.
Defaults to: `in-memory` + | ||
|
||
|
||
`quarkus.scheduler.instance-id`:: The instance id of the scheduler. This is highly required when running clustered schedulers as each node in the cluster MUST have a unique instanceId. |
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.
Isn't auto good enough?
Defaults to: `AUTO` + | ||
|
||
|
||
`quarkus.scheduler.thread-count`:: The size of scheduler thread pool. This will initialise the number of worker threads in the pool |
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.
I wonder if we really need a thread pool exposed. Again back to the implementation abstraction, we could ahve a non blocking one demanding no thread.
[[creating-scheduling-job]] | ||
.About creating database tables when using `jdbc` state store | ||
===== | ||
The Quarkus scheduler does not create the necessary scheduling tables in database automatically. If these tables are missing, the schuduler will throw an excpetion during application startup. |
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.
s/schuduler/scheduler/
I only reviewed the doc. Not the rest. |
+1 on this idea from me |
Let me close this since it lacks native support. @emmanuelbernard @geoand
@masini thanks for your interest in having this feature, if you okay with having JVM only, could you please try Emmanuel suggestion above?. |
Hi Manyanda, thank you for your interest in clustering job.
This is something that I need in a lot of my projects and it's sad to see
that we can't find a way to add it to Quarkus.
I'm currently not interested in native images, I saw a usage for native
compilation only for serverless Java and not for long running applications.
Sure leaking the Quartz implementation is not a good encapsulation, but
currently there a lot of this violations in Quarkus:
1) Hibernate only properties that violates JPA
2) Vert.x properties that are not satisfied using Undertow
and may be many more, but this is not an issue, I'm happy with them and I
use them as needed.
I think I'll try using your code to work on a clustered timer
implementation, but I'm quite sure I'll not go in production with something
I'm not 100% sure.
Have a nice night.
Il giorno lun 7 ott 2019 alle ore 23:15 Manyanda Chitimbo <
[email protected]> ha scritto:
… Closed #3783 <#3783>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3783?email_source=notifications&email_token=AAPXERS6G3IJFBA7KV6RW2DQNORH7A5CNFSM4ISN5KDKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOUCERCWQ#event-2693337434>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAPXERVO23CBVHIPZUXMW5LQNORH7ANCNFSM4ISN5KDA>
.
--
****************************************
http://www.lucamasini.net
http://twitter.com/lmasini
http://www.linkedin.com/pub/luca-masini/7/10/2b9
****************************************
|
I have opened up #5529 As for the native part, I have been to workaround this by using Properties instead (in jVM and native mode) - https://github.com/quarkusio/quarkus/pull/5529/files#diff-f3233ae68279acfe2869eaffaeb10682R248 and https://github.com/quarkusio/quarkus/pull/5529/files#diff-4cf9981ea9b1aafb626d63db64005fc8R54. |
Fixes #3520
/cc @masini this could interest you :-)