Annotation Interface EnableTask


Enables the TaskLifecycleListener so that the features of Spring Cloud Task will be applied.

 @Configuration
 @EnableTask
 public class AppConfig {

        @Bean
        public MyCommandLineRunner myCommandLineRunner() {
                return new MyCommandLineRunner()
    }
 }
 
Note that only one of your configuration classes needs to have the @EnableTask annotation. Once you have an @EnableTask class in your configuration the task will have the Spring Cloud Task features available.
Author:
Glenn Renfro