• Post Reply Bookmark Topic Watch Topic
  • New Topic

Suggestions for starting Schdeulor on one server in a cluster  RSS feed

 
Ankur Luthra
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using quartz and Spring for Scheduling some Task. I have two methods as below which are exposed as REST GET methods and when request with path as"../startSchedulor" OR "../stopSchedulor" is made, I start OR stop scheduler



This REST service is deployed along with other REST services in the project.Now when i will deploy the project in a cluster with say 5 servers and I hit /startSchedulor and the request goes to say server-1, it will start scheduler on server-1.Now when I will hit /stopSchedulor it is not guaranteed that server-1 will take the request and stop my schedulor. How can i make sure that my scheduler is stopped when i hit /stopSchedulor URL.

One way I can think of is to package the REST service separately and deploy it only on one server.Any other way to overcome this?

P.S. :- same has been posted on Stack Overflow "http://stackoverflow.com/questions/25911077/suggestions-for-starting-schdeulor-on-one-server-in-a-cluster"

Regards,
Ankur
 
Vijitha Kumara
Bartender
Posts: 3973
24
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Typically in a cluster you would find every node acting in a similar way that any request can be served equally which is the purpose of having the same.

I'm not sure what the real use of these scheduler methods. Is this type of a scheduler really depends on an external invocation? If not can be added as a Cron job or similar? Or you might want to think of a different strategy for this particular functionality?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!