dropwizard-sundial icon indicating copy to clipboard operation
dropwizard-sundial copied to clipboard

Create new `Manual` trigger annotation

Open timmolter opened this issue 8 years ago • 7 comments

So that the scheduler loads it on startup, but it's just a manually triggered job. Eliminates need for jobs.xml in some cases.

timmolter avatar Jun 10 '16 11:06 timmolter

Was this ever added? I presume to have a job ready to fire but be triggered externally by another web service for example.

Gaudon avatar Jan 17 '18 21:01 Gaudon

Not yet, sorry. You could try programmatically creating a SimpleTrigger with repeat set to -1, which will fire only once.

timmolter avatar Jan 18 '18 09:01 timmolter

Yeah it would be a very useful feature to have.. in the case of scaling infrastructures I would like to avoid having 'n' number of instances running the same jobs in parallel / at all. Instead, I'd like to have an external trigger hit the web api to launch the job on a single instance that may be passed the request through something like a router / load balancer.

Gaudon avatar Jan 18 '18 14:01 Gaudon

In case you didn't see it and it's useful, if you set concurrency = false, then only one instance of the job will run.

timmolter avatar Jan 18 '18 15:01 timmolter

I did see that setting, but in this case the same source / compiled code is deployed on additional scaling instances without any knowledge of one another (from the code's perspective). Considering this, I don't believe the concurrency feature is applicable to my use case.

I'm thinking of the case where a front end load balancer is serving X number of servers, all running the same code, which all contain the same sundial jobs. Externally a job request comes in (with a token) through the load balancer and is handed off to any single instance (usually the one with the least load) with instructions / credentials to execute a given job (such as a maintenance routine) on a common database between all instances.

Gaudon avatar Jan 18 '18 15:01 Gaudon

you could try quartz, as it's been designed to run across multiple machines. the job statuses are coordinated via a central DB.

timmolter avatar Jan 19 '18 11:01 timmolter

I've heard of Quartz, but Sundial just seemed "better" hah. But with that being said I'll look into it and see if it fits my use case any better.

Cheers.

Gaudon avatar Jan 19 '18 12:01 Gaudon