27

Spring Boot 2 实战:自定义启动运行逻辑 - - SegmentFault 思否

 4 years ago
source link: https://segmentfault.com/a/1190000020890133
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
不知道你有没有接到这种需求,项目启动后立马执行一些逻辑。比如缓存预热,或者上线后的广播之类等等。可能现在没有但是将来会有的。想想你可能的操作, 写个接口上线我调一次行吗?NO!NO!NO!这种初级菜鸟才干的事。今天告诉你个骚操作使得你的代码更加优雅,逼格更高。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK