在凭据更改后,是否可以在Springboot中再次在Springboot中以编程方式重新运行@configuration类?
我有一个@configuration类,该类在RESTTEMPLATE中的登录凭据设置为另一个Spring应用程序的标题。 现在,当其他应用程序重新启动时,凭据不再有效。
因此,问题是,当凭据不再有效时,是否可以通过编程方式再次运行此@configuration类?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查下面的文章是否有帮助!
上下文(这篇文章似乎相关吗?)
Check if below articles help !
https://www.baeldung.com/java-restart-spring-boot-app
Programmatically restart Spring Boot application / Refresh Spring Context (Does this article seem relevant? )
https://javapointers.com/spring/spring-boot/how-to-restart-spring-boot-automatically-using-actuator/ (You can use actuator end point from another application to trigger a restart :P Although now recommended solution)