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
I ended up creating a separate @Configuration class for scheduling and used the @ConditionalOnProperty annotation to toggle scheduling
@Configuration
@EnableScheduling
@ConditionalOnProperty(prefix = "scheduling", name="enabled", havingValue="true", matchIfMissing = true)
public class SchedulerConfig {
}
in my application.yml file I then added
scheduling:
enabled: true