[英]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.