Spring Boot: Startup init through @PostConstruct

There are frequent situations when application requires to run custom code while starting up. There are several ways how to do it in Spring Boot, one of my favorites is to create @Component class with method annotated with @PostConstruct . This simple component class is scanned during Spring Boot application start and method annotated by @PostConstruct is run just after all services initialized. Such…