as stated in the title of a question, I need to set Spring Scheduler that will run method to load something from database into memory, every day around 4AM
The thing is that I have multiple instances of this server and I don't want all to start executing at the same time cause it will slow down the DB. So I want the time to be at a random minute somewhere between 4:00AM and 4:30AM
So lets say one instance will start everyday at 4:03AM, the other at 4:09AM, third at 4:21AM etc. The execution of query lasts for 1 minute.
Is this possible to do with cron expression, but without using $RANDOM bash (cause I think I dont have it) , or maybe I need to inject this random value some other way into
@Scheduled(cron="* randomMinuteValue 4 * * *")