Note that there are some explanatory texts on larger screens.

plurals
  1. POlooking for persistent timers for a spring application
    primarykey
    data
    text
    <p>I'm looking for a lib that allow me to do</p> <ol> <li>define a worker that will be invoked once on a specific time in the future (not need the re-schedule / cron like featrure) i.e. a Timer</li> <li>The worker should accept a context which withe some parameters / inputs</li> <li>all should be persistent in the DB (or file) the worker </li> <li>worker should be managed by spring -- spring should instantiate the worker so it can be injected with dependencies </li> <li>be able to create timers dynamically via API and not just statically via spring XML beans</li> </ol> <p>nice to have:</p> <ol> <li>support a cluster i.e. have several nodes that can host a worker. each store jobn in the DB will cause invokaction of ONE work on one of the nods</li> </ol> <p>I've examined several alternatives none meets the requirements:</p> <ul> <li><strong>Quartz</strong> </li> </ul> <p>when using org.springframework.scheduling.quartz.JobDetailBean makes quartz create your worker instance (and not by spring) so you can't get dependecy ijection, (which will lead me to use Service Locator which I want to avoid)</p> <p>while using org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean you can't get a context. your Worker expose one public method that accepts no arguments.In addition when using MethodInvokingJobDetailFactoryBean you can't use persistence (form the Javadoc) </p> <blockquote> <p>Note: JobDetails created via this FactoryBean are not serializable and thus not suitable for persistent job stores. You need to implement your own Quartz Job as a thin wrapper for each case where you want a persistent job to delegate to a specific service method.</p> </blockquote> <ul> <li>Spring's Timer and simple JDK Timers does not support the persistence / cluster feature </li> </ul> <p>I know I can impl thing myself using a DB and Spring (or even JDK) Timers but I prefer to use an a 3r party lib for that.</p> <p>Any suggestions? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload