We use this in production as it helps with different service runners (mainly to support windows proc-run that send stop/retart commands via the same open jvm and its running classloader)
The shared jar launcher means its possible to send commands to the same open service loaded via spring-boot
Comment From: pivotal-issuemaster
@alero Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.
Comment From: alero
Will wait for feedback before I progress with CLA and/or tests, not sure if this is seen as a feature that would be needed by the spring-boot community
Comment From: wilkinsona
Thanks for the PR, @alero. Can you give us an example of how you typically use the shared launcher? What's the entry point to the JVM where the shared instance of the launcher exists?
Comment From: alero
Hi, yes we utilize proc-run to run the spring-boot services within windows servers, this binds the service to the windows service management and makes it possible to stop/start/restart. But this does not utilize the more common way of sending kill signals to the JVM but rather calls the same main method again but with a kill/stop word, to be able to actually shutdown the running JVM we must be able to reach the classloader that runs the spring-boot application
https://commons.apache.org/proper/commons-daemon/procrun.html
Samples for how the code get called.
java -classpath "target/spring-boot-application.jar" org.springframework.boot.loader.SharedJarLauncher start
java -classpath "target/spring-boot-application.jar" org.springframework.boot.loader.SharedJarLauncher stop
this is within the same started JVM and to be able to handle the stop command the service needs to be shared cross classloaders (using the regular jarlauncher nothing get stopped when the stop command executes)
Comment From: wilkinsona
Thanks for the info, @alero. I've flagged this one for team attention so that we can discuss whether or not this is something that we want to support out of the box.
Comment From: wilkinsona
Thanks for the suggestion. We've discussed this today and the team have decided that we do not want to add shared launcher support to Spring Boot at this time. We haven't seen sufficient demand for the functionality to justify the ongoing maintenance cost. Thanks anyway.