简体   繁体   English

CommandLineRunner VS SmartLifecycle

[英]CommandLineRunner VS SmartLifecycle

with @PostConstruct and autowiring a MessageChannel problem, I found a solution SmartLifecycle.start() 通过@PostConstruct并自动装配MessageChannel问题,我找到了解决方案SmartLifecycle.start()

can one also use CommandLineRunner ? 可以同时使用CommandLineRunner吗?

what is the best way to start work with MessageChannel rabbitMQ after a full initialization of the context? 在上下文完全初始化之后,开始使用MessageChannel rabbitMQ的最佳方法是什么?

Spring Boot's CommandLineRunner (or ApplicationRunner ) is fine. Spring Boot的CommandLineRunner (或ApplicationRunner )很好。

SmartLifecycle is available for any Spring application, not just Boot applications. SmartLifecycle可用于任何Spring应用程序,而不仅仅是Boot应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM