Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Re-deploy spring boot service without restart?

I have developed a micro service (Spring Boot REST service, deployed as executable JAR) to track all activities from third party projects as my requirement and its working now.

Currently it's working apart of some projects, and now I have updated service with some additional features.

But I can't move it to live server without restarting the existing service as it is deployed as jar. I'm afraid to restart my service, restart may be leads to lose data of integrated projects.

What improvements can I make in my architecture to solve my problem?

like image 878
Jamsheer Avatar asked Sep 22 '16 13:09

Jamsheer


People also ask

How do I reload my changes on spring boot without having to restart server?

In Spring Boot this can be achieved by adding a DevTools module, just add the following dependency in your Spring Boots pom. xml and build it. Spring Boot DevTools module does exactly what developers needed, this eliminates the process of manually deploying the changes.

How do I restart my spring boot?

Another way to restart our application is to use the built-in RestartEndpoint from Spring Boot Actuator. In the above code, we are using the RestartEndpoint bean to restart our application. This is a nice way of restarting because we only have to call one method that does all the work.

Can we use spring boot without Microservices?

Spring Boot in itself has nothing to do with microservices. It's a Spring module which simply makes the configuration of your app easier. As such, it absolutely can be used in a monolithic app.


1 Answers

What about JRebel plugin. It worked perfectly for me, but, unfortunately, it's not a free app. Like alternative, (i used this approach with Spring MVC, with Spring Boot it could be otherwise), I set up a soft link in work directory on a compiled path in JBoss (in my case it was dir with name target and *.class and *.jar files). As for me, the first solution with JRebel is the most appropriate for you.

like image 87
Artem Avatar answered Oct 03 '22 15:10

Artem