I am writing a Spring Boot App
My requirements are - In the resources (src/main/resources) folder if I add new xml files.. I should read those files and get some ur
You can do that over a spring annotation:
@Scheduled(fixedRate = 360000)
public void parseXmlFile() {
// logic for parsing the XML file.
}
Please note that the method must be void. Furthermore, in your main class, you must enable scheduling:
@SpringBootApplication
@EnableScheduling
public class Application {
public static void main(String[] args) throws Exception {
SpringApplication.run(Application.class);
}
}
Please see the full reference here: https://spring.io/guides/gs/scheduling-tasks/