简体   繁体   English

在Spring Boot中使用服务包装器而不是jar运行的优势是什么?

[英]What is advantage of using service wrapper in Spring boot instead of jar running?

Spring document has mentioned about service wrapper in http://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html . Spring文档在http://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html中提到了有关服务包装的内容。

On production, we can use java -jar [x].jar to run our application which it's more easier. 在生产中,我们可以使用java -jar [x].jar来运行我们的应用程序,这更容易。

What are those advantage to use service wrapper ? 使用服务包装器有哪些优势?

What is advantage of using service wrapper in Spring boot instead of jar running? 在Spring Boot中使用服务包装器而不是jar运行的优势是什么?

If the application should restart automatically when the server reboots because of power failure, hardware failure or some other temporary condition then the service approach primarily has the advantage that you don't have to login to the machine to start the jar . 如果由于电源故障,硬件故障或某些其他临时情况而导致应用程序在服务器重新启动时应自动重新启动,则该服务方法的主要优点是您无需登录计算机即可启动jar Which is useful if it's production software and 3 am when the janitor pulls the server plug to vacuum. 如果它是生产软件,并且在管理员将服务器插头拉到真空位置的凌晨3点,这将很有用。

另外,如果应用程序JVM崩溃(内存不足,JVM错误等),JSW将重新启动它。

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

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