title: How to reload the spring beans at runtime after hitting /actuator/refresh endpoint?
body: <p>I'm trying to reload the spring bean by using the actuator refresh endpoint with the help of @RefreshScope annotation at bean level in spring boot 2.2.7 version.</p>
  <p>But my HelloWorld bean is not getting refreshed by hitting the refresh endpoint. Can anyone please help me out ?</p>
  <p><strong>My main class:</strong></p>
  <pre><code>@SpringBootApplication
  public class SampleApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(SampleApplication.class, args);
      }
  
  }
  </code></pre>
  <p><strong>HelloWorld:</strong></p>
  <pre><code>public class HelloWorld {
      private String message;
  
         public void setMessage(String message){
            this.message  = message;
         }
         public void getMessage(){
            System.out.println(&quot;Your Message : &quot; + message);
         }
      
  }
  </code></pre>
  <p><strong>ApplicationConfiguration:</strong></p>
  <pre><code>@Configuration
  public class ApplicationConfiguration {
      @Bean
      @RefreshScope
      public HelloWorld helloWorld() {
          System.out.println(&quot;From HelloWorld&quot;);
          return new HelloWorld();
      }
  }
  </code></pre>
  <p><strong>application.properties:</strong></p>
  <pre><code>management.endpoints.web.exposure.include=*
  </code></pre>