Home > Back-end >  Nacos - config after modify configuration cannot refresh to obtain the latest data in real time
Nacos - config after modify configuration cannot refresh to obtain the latest data in real time

Time:10-04

The bootstrap. Properties
` ` `
Spring. The application. The name=nacos - config
Server port=8100
Spring. Cloud. Nacos. Config. Server - addr=localhost: 8848
Spring. Cloud. Nacos. Config. File - the extension=yaml

` ` `
DemoController. Class

` ` `
@ RestController
@ RefreshScope
Public class ExampleController {

@ Value (" ${user. The name} ")
private String name;

@ GetMapping (" test ")
Public String example () {
System. The out. Println (name);
Return the name;
}


}
` ` `



Each time a service restart can access to the latest configuration information, but you can't dynamically refresh, don't take effect after the modification of nacos configuration file content distribution


CodePudding user response:

This is strange, see your screenshot, service is received update news at the centre of the configuration, I can be successful, configuration, user. The name I have an initial value in yaml, how much you use version

CodePudding user response:

reference 1/f, gorgeous dream reply:
this is strange, see your screenshot, service is received update news at the centre of the configuration, I can be successful, configuration, the user. The name I have an initial value in yaml, how much you use version


My side began to build, so basic it is the latest version to use, set up several times is the result

CodePudding user response:

refer to the second floor w busines response:
Quote: reference 1/f, gorgeous dream reply:

This is strange, see your screenshot, service is received update news at the centre of the configuration, I can be successful, configuration, user. The name I have an initial value in yaml, how much you use version


My side began to build, so basic it is the latest version to use, set up several times are the result of
has the need to add me, can I send you the pom and so on
  • Related