TomEE is using quartz to implement @Schedule
methods. At the beginning quartz was hidden and its configuration was not exposed.
Since some days it is no more the case!
Now you can specify in several configuration files all quartz properties you want.
Here are the files (to put in META-INF or WEB-INF for webapps):
- application.properties
- module.properties
- openejb-jar.xml in bean properties
The available configuration is well explained on quartz website and can even let you configure quartz in cluster: http://quartz-scheduler.org/documentation/quartz-2.x/configuration/
The nice stuff is now the schedulers can be specific by bean and the schedulers can be monitored/updated through JMX (deactivable if necessary).
Here a little sample of configuration:
org.quartz.scheduler.instanceName = my-app org.quartz.scheduler.instanceId = my-bean org.quartz.threadPool.threadCount = 10 org.quartz.threadPool.class = org.superbiz.MyCustomThreadPool org.quartz.plugin.LogPlugin.class = org.superbiz.MyLogPlugin org.quartz.plugin.LogPlugin.active = true
Another more real example can be found here: http://quartz-scheduler.org/documentation/quartz-2.x/configuration/ConfigJDBCJobStoreClustering
A big thanks to Enrico Olivelli who helped/helps a lot on this topic.
Want more content ? Keep up-to-date on my new blog
Or stay in touch on twitter @rmannibucau
What with setting like openejb.timer.pool.size?
Hi
actually it just configure the size of the default thread pool, if you change it it is ignored.
For those like me who landed here looking for a way to increase the default EJB timer pool size, the correct property name for TomEE 1.6.0 / OpenEJB 4.6.0 is EjbTimerPool.CorePoolSize instead of openejb.timer.pool.size. The property should be specified in tomee/conf/system.properties.
Thank you Romain for your help on the mailing list 🙂
Yeah, thanks for the catch, we’ll add back previous config too since that’s a regression