Thanks for the suggestion Jon. We added org.quartz-scheduler as a dependency
to our project and configured it in web.xml. With that, we could get a second
Scheduler started and use JobStoreTX.
However, our code schedules task using javax.ejb.Schedule annotation, e.g.:
@Schedule(minute = "*", hour = "*")
public void schedulerTest() {
LOGGER.info("Entered schedulerTest");
}
and this still uses the Scheduler started by TomEE and not the one we want.
AFAIK, @Schedule does not have any parameter to specify which Scheduler to
use.
How can we make this to use the Scheduler we want?
> On Dec 20, 2019, at 04:23, Jonathan Gallimore <[email protected]>
> wrote:
>
> TomEE uses Quartz internally to schedule EJB timers etc - the reason for
> shading it is to avoid it conflicting with Quartz packaged in your
> application. So theoretically, you should be able to package Quartz in your
> application, and use it per its own documentation. If you have a code
> sample with your issue that you can provide us with, we'd be happy to take
> a look.
>
> Cheers
>
> Jon
>
> On Fri, Dec 20, 2019 at 4:13 AM Ihsan Ecemis <[email protected]> wrote:
>
>>
>> Hello Everyone,
>>
>> We would like to store Quartz scheduling information within a relational
>> database. We tried different configuration options to use our own
>> properties file instead of TomEE's default, but could not get it to work.
>>
>> Here are the things we tried:
>>
>> (1) We defined the system property 'org.quartz.properties', e.g. did
>> "-Dorg.quartz.properties=/tmp/quartz.properties".
>> (2) Since TomEE shades org.quartz, we also tried
>> "-Dorg.apache.openejb.quartz.properties=/tmp/quartz.properties".
>> (3) We also tried configuring this via web.xml file by adding:
>>
>> <context-param>
>> <param-name>quartz:config-file</param-name>
>> <param-value>/tmp/quartz.properties</param-value>
>> </context-param>
>>
>>
>> In all these cases, even though we set org.quartz.jobStore.class =
>> org.quartz.impl.jdbcjobstore.JobStoreTX (or
>> org.apache.openejb.quartz.jobStore.class =
>> org.apache.openejb.quartz.impl.jdbcjobstore.JobStoreTX) and adjust all
>> parameters as documented at Quartz User Guide, TomEE is initializing
>> RAMJobStore instead of JobStoreTX. Also, there is no indication in the
>> logs that Quartz is opening our properties file.
>>
>> How can we configure Quartz under TomEE?
>>
>> Any help would be greatly appreaciated.
>>
>> Thanks,
>>
>> Ihsan.