Git Product home page Git Product logo

Comments (14)

wchappygood avatar wchappygood commented on June 27, 2024

image
这个对象初始化的时候,
image
这个对象还没初始化导致,配置没有修改到

from spring-cloud-tencent.

wchappygood avatar wchappygood commented on June 27, 2024

找到原因了
image

from spring-cloud-tencent.

SkyeBeFreeman avatar SkyeBeFreeman commented on June 27, 2024

如果使用bootstrap.yml做配置,需指定spring.cloud.polaris.enabled为true。

from spring-cloud-tencent.

wchappygood avatar wchappygood commented on June 27, 2024

如果使用bootstrap.yml做配置,需指定spring.cloud.polaris.enabled为true。

我说下我的理解不知道对不对:
配置PolarisConfigBootstrapAutoConfiguration在bootstrap阶段就会创建PolarisContext,并把PolarisConfigModifier处理了,
而StatConfigModifier并非是bootstrap阶段,所以就无法修改配置了。

所以现在有没什么其他方法方法可以用配置中心的配置去修改配置,达到自定义端口的效果

from spring-cloud-tencent.

SkyeBeFreeman avatar SkyeBeFreeman commented on June 27, 2024

有PolarisStatPropertiesBootstrapConfiguration,那么bootstrap阶段,StatConfigModifier应该会生效才对

from spring-cloud-tencent.

SkyeBeFreeman avatar SkyeBeFreeman commented on June 27, 2024

在你的bootstrap.yml下加一个这个配置试试呢?

spring:
  config:
    import: optional:polaris

from spring-cloud-tencent.

wchappygood avatar wchappygood commented on June 27, 2024

PolarisStatPropertiesBootstrapConfiguration

image
需要手动设置这个值才能生效
但是还是不能读取配置中心的配置来设置端口

from spring-cloud-tencent.

wchappygood avatar wchappygood commented on June 27, 2024

在你的bootstrap.yml下加一个这个配置试试呢?

spring:
  config:
    import: optional:polaris

不得行,还是无法读取配置中心的配置设置端口

from spring-cloud-tencent.

SkyeBeFreeman avatar SkyeBeFreeman commented on June 27, 2024

@wchappygood 如下配置无法设置远端配置的端口吗?我这里尝试是可以的。

spring:
  config:
    import: optional:polaris
  cloud:
    polaris:
      enbaled: true

from spring-cloud-tencent.

wchappygood avatar wchappygood commented on June 27, 2024

@wchappygood 如下配置无法设置远端配置的端口吗?我这里尝试是可以的。

spring:
  config:
    import: optional:polaris
  cloud:
    polaris:
      enbaled: true

可以改变。但是只能通过配置在bootstrap.yml才能生效。

from spring-cloud-tencent.

SkyeBeFreeman avatar SkyeBeFreeman commented on June 27, 2024

@wchappygood 你的诉求是,这个配置也只通过远程配置吗?

spring:
  cloud:
    polaris:
      enbaled: true

bootstrap.yml只留?

spring:
  config:
    import: optional:polaris

from spring-cloud-tencent.

wchappygood avatar wchappygood commented on June 27, 2024

@wchappygood 你的诉求是,这个配置也只通过远程配置吗?

spring:
  cloud:
    polaris:
      enbaled: true

bootstrap.yml只留?

spring:
  config:
    import: optional:polaris

我们的诉求是spring.cloud.polaris.stat.port这个可以配置在配置中心,我们用bootstrap.yml启动的

from spring-cloud-tencent.

SkyeBeFreeman avatar SkyeBeFreeman commented on June 27, 2024

@wchappygood 我用这个配置,是可以支持你的需求的。
应用内bootstrap.yml:

spring:
  config:
    import: optional:polaris
  cloud:
    polaris:
      enbaled: true

配置中心:
image

from spring-cloud-tencent.

wchappygood avatar wchappygood commented on June 27, 2024

spring.cloud.polaris.stat.port

谢谢成功了

from spring-cloud-tencent.

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.