title: Call Spring actuator /restart endpoint from Spring boot using a java function
body: <p>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: </p>
  
  <pre><code>Thread thread = new Thread(new Runnable() {
      @Override
      public void run() {
          RestartEndpoint p = new RestartEndpoint();
          p.invoke();
      }
  });
  thread.setDaemon(false);
  thread.start();
  </code></pre>