DEV Community

Discussion on: Bending Time in Spring Applications

Collapse
 
xavier_1023 profile image
Javier Solis Guzman

This is a great article, I only want to know if you know an alternative to avoid multiples instances problem.

Collapse
 
tobhai profile image
Tobias Haindl

Hi, thanks!
I'm not sure if I fully understand your question. Can you maybe rephrase it?

Collapse
 
xavier_1023 profile image
Javier Solis Guzman

Yes, if I add this code to a microservice that it has at least 3 instances, the event will be launched 3 times, so I suppose you should have an specific microservice to run this kind of "jobs" or do you know how to avoid this?

Thread Thread
 
tobhai profile image
Tobias Haindl

You are correct, the event will be launched 3 times if you have 3 instances running.
If you need distributed job scheduling have a look at: JobRunr or db-scheduler!

Thread Thread
 
xavier_1023 profile image
Javier Solis Guzman

thanks, for your article and the recomendations.