How to configure RAMJobStore and JDBCJobStore in single java application - quartz-scheduler

I have configured the simple trigger scheduler program using RAMJobStore in my application to execute set of methods and it is working fine. Now I am trying to configure JDBCJobStore (Oracle) to execute another set of methods in the same java application. My goal is to schedule a method to get triggered based on user defined date/time which is obtained dynamically through GUI.
I am using quartz 1.6.2 and have no idea about JDBCJobStore. I need to use JDBCJobStore for my part of program without affecting the existing RAMJobStore part, someone please help me to proceed further with some suggestion/examples?

you need to have two schedulers one using RAMJobStore , another using JDBCJobStore.

Related

How to test quartz job

I'm using quartz framework to setup a schedule task in java.
eg: I hope the job will be triggered at 12:00 o'clock from 2022-01-25 to 2022-01-29.
is there any way that I can change the quartz's calendar to a specific date and time to make the schedule job can be triggered immediately?
if today is 2022-01-20, how can I mock current date and time in jvm, rather than bring up my spring boot service and wait, until that day...
thanks for your help.
The easiest way is probably using some of the GUI-based Quartz scheduler managers that let you connect to your Quartz scheduler manually execute arbitrary jobs through a GUI.
Here is an example of how to do that using QuartzDesk (I am biased here), but other tools may work similarly. Even the QuartzDesk Lite (free) edition lets you do that. No application code changes are required.

Can I have a custom Setup method in gatling

I want to have a custom setup method like for a test where i talk to a webservice and get initial values. Can i do this in gatling?I only want to run this once per simulation.
You can use the before hook to perform any custom code before running the simulation. Note that you can't use Gatling's DSL in there. But you can use whatever Java HTTP client you want, from java.net.UrlConnection to AsyncHttpClient that Gatling ships.

Location for scheduled tasks in SailsJS

I need to build a few tasks that import various data from outside APIs in my SailsJS project. I was thinking of using laterJS (unless there's a better option).
Is there a best practice for the location and loading of these "task" files?
The place where I think it should go is file config/bootstrap.js.
Description of this file from sails-docs:
This is an asynchronous boostrap function that runs before your Sails app gets lifted (i.e. > starts up). This gives you an opportunity to set up your data model, run jobs, or perform
some special logic.

Settings for Quartz scheduler - Mule

I have developed a Mule(3.3) application consisting of multiple scheduled events using Quartz end-point.
I have created a mule-config.xml and deployed it in Mule server, and i can see events triggered at specified time.
Now, I need to implement a feature where i can have setting (configured in properties file or XML file) to ON/OFF the quartz scheduler.
ON means the event to be triggered and OFF means the events not to be triggered. But i cannot see any such settings in Mule.
Any pointers as how to solve this will be helpful.
Thanks.
Personally, instead of trying to pause/restart the endpoint, I would let the Quartz events fire but switch-off downstream processing with something similar to what's discussed here: Mule 3: Controlling whether a flow is allowed to be executed

Can I inject new jobs into the Quartz JDBCJobStore without clustering enabled?

I have several web-servers and need them to use Quartz. The clustering feature of Quartz would be ideal, but it requires that the servers clocks are in complete sync. They have a very scary warning about this:
Never run clustering on separate machines, unless their clocks are synchronized using some form of time-sync service (daemon) that runs very regularly (the clocks must be within a second of each other).
I cannot guarantee complete clock synchronization, so instead of using the clustering feature I was thinking to have a single Quartz instance (with a stand-by for fail-over). Having a single instance executing jobs is not a problem, but I still need all of the web servers to be able to schedule jobs.
Can I directly add jobs into the JDBCJobStore from the web servers, and will they be picked up by the (non-clustered) Quartz server? I would be doing this by creating schedule instances in the web servers to add jobs. These instances would never be started, just used to access the JobStore.
Wrote a test program that creates a "non-clustered" Quartz scheduler using the same JobStore as the "real" scheduler (also non-clustered), and schedules jobs. After a few seconds, these jobs do get executed, so it seems to work.
Update: I cross-posted this question to the Quartz forum, and got the answer that this should work. In a related question they state that
The jobs can be inserted into that database by another process by:
1- using the rmi features of quartz from another process, and using the quartz API
2- instantiating a scheduler within another process (e.g. webapp), also pointing it to the same database, but NOT start()ing that scheduler instace, and the using the quartz api to schedule jobs.