I'm looking to restart the spring boot app, so using Spring Actuator /restart endpoint is working using curl, but i'm looking to call the same function using java code from inside the app, i've tried this code, but it's not working:
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
RestartEndpoint p = new RestartEndpoint();
p.invoke();
}
});
thread.setDaemon(false);
thread.start();