` ` `
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 versionCodePudding user response: