I am building a application that uses quartz scheduler which is triggered every 30 min. Since we have clustered servers, if the application is deployed it will do the job twice , which we don't want to happen. Therefore we decided to use socket approach which requires port and ip . My question is , how would i implement socket approach if only one instance is to run in whole clustered environment ? Any suggestion or help and example code will be highly appreciated.
Asked
Active
Viewed 309 times
1 Answers
0
You may use a approach of JMS or similar, where you publish the task to be done on a Queue. With the nature of queue, that only one consumer can consume that message, you can be sure one of the instances should pick the task and run.

Juned Ahsan
- 67,789
- 12
- 98
- 136
-
can you provide some sort of example. Thank you for your response sir. – nepJava Jul 17 '13 at 16:54