I have a problem with Spring’s @Scheduled annotation.
Basically, what I’m trying to do is this :
class service1 {
@Scheduled(fixedDelay=120000) //120 seconds
public void processSomething() {
//something that processes very quick - a few seconds
beanX.processSomething();
...
}
}
class service2 {
@Scheduled(cron="0 0 10 * * ?")
public void processSomething() {
//something that processes very slowly - a few hours
beanX.processSomething();
...
}
}
The idea in the above is that two different scheduled processes are invoking the same spring bean.
The problem I have is this :
Once the service2 is triggered, service1 stops getting triggered at all.
Sorry guys, this is not an issue anymore. It was my own stupidity actually. The issue was that Spring was having a very small thread pool, and I was exceeding that one by running a bunch of other threads in the same time.