Git Product home page Git Product logo

Comments (6)

yuluo-yx avatar yuluo-yx commented on June 28, 2024

/kind question
/area nacos

from spring-cloud-alibaba.

ruansheng8 avatar ruansheng8 commented on June 28, 2024

基于 @ConfigurationProperties 声明的属性配置类,可以实时动态刷新(refresh-enabled 默认为开启状态),如果使用 Spring 中的 @Value 方式,在类上添加 @RefreshScope 也可以实现动态刷新。

如果你的动态刷新功能失效,可以贴一下你代码中具体是如何使用的

from spring-cloud-alibaba.

Mredust avatar Mredust commented on June 28, 2024

基于 @ConfigurationProperties 声明的属性配置类,可以实时动态刷新(refresh-enabled 默认为开启状态),如果使用 Spring 中的 @Value 方式,在类上添加 @RefreshScope 也可以实现动态刷新。

如果你的动态刷新功能失效,可以贴一下你代码中具体是如何使用的

如果不使用 @ConfigurationProperties 、@RefreshScope和 @NacosValue ,单单只是使用 refresh-enabled 能否生效。但是我用了后发现不生效并不会实时刷新
image
image
image

from spring-cloud-alibaba.

ruansheng8 avatar ruansheng8 commented on June 28, 2024

@Mredust@Value 必须配合 @RefreshScope 一起使用才行实现动态刷新,这个机制和 Spring Cloud 官方的定义保持一致,因为有的场景是希望启动后值就固定,不允许动态刷新,所以需要动态刷新的场景需要手动添加 @RefreshScope

from spring-cloud-alibaba.

Mredust avatar Mredust commented on June 28, 2024

@Mredust@Value 必须配合 @RefreshScope 一起使用才行实现动态刷新,这个机制和 Spring Cloud 官方的定义保持一致,因为有的场景是希望启动后值就固定,不允许动态刷新,所以需要动态刷新的场景需要手动添加 @RefreshScope

明白了,感谢感谢

from spring-cloud-alibaba.

github-actions avatar github-actions commented on June 28, 2024

This issue has been open 30 days with no activity. This will be closed in 7 days.

from spring-cloud-alibaba.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.