0

When using spring cloud config client , I try to update my app config via update application.properites file. But it dose not work.

What i already try : update config file , and commit to git;

Dose anyone know what is going on ? I try to test it it result in controller String value like below:

@Value("${my-name}")
private String name;

And i already add @RefreshScope in my client side config; Did I miss something ?

pvpkiran
  • 25,582
  • 8
  • 87
  • 134
Y.Ido
  • 333
  • 1
  • 11

1 Answers1

1

I finally work work why. It did not work because I put @RefreshScope in a wrong place. If we want it to work work , we need to place @RefreshScope to the Configuration Class that we want to update value . So , in my case , I need to place it to the Controller class that using this bean value.

@RefreshScope
public class ClientController {
    @Value("${my-name}")
    private String name;
} 
Y.Ido
  • 333
  • 1
  • 11