Created
January 18, 2022 17:13
-
-
Save engleangs/d281589522402f41f15c8d072c9b14bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SpringBootApplication | |
public class Application implements CommandLineRunner { | |
private static final Logger LOGGER = LoggerFactory.getLogger(Application.class); | |
@Autowired | |
private SmsService smsService; | |
@Override | |
public void run(String... args) throws Exception { | |
LOGGER.info("running"); | |
Runtime.getRuntime().addShutdownHook(new Thread(() -> { | |
smsService.stop(); | |
})); | |
smsService.start(); | |
Thread.currentThread().join(); | |
} | |
public static void main(String[] args) { | |
SpringApplication.run(Application.class, args); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment