Is there a way to make @EnableScheduling conditional based on an application property? also is it possible to disable controllers based on properties too?
What I\'m tryi
prefix
in @ConditionalOnProperty
@Bean
in configuration class.My variant:
@Component
@EnableScheduling
@ConditionalOnProperty(value = "scheduler.enabled", havingValue = "true")
public class MyScheduler {
@Scheduled(...)
public void doWork() {
...
}
}