当前位置: 首页 > 知识库问答 >
问题:

为什么Spring Boot应用程序总是从配置服务中获取配置?

司马高明
2023-03-14
06:04:28.586 [serviceId:xxx-service/traceId:545d584f10da3123/spanId:545d584f10da3123/parentId:] INFO  o.s.c.c.c.ConfigServicePropertySourceLocator.getRemoteEnvironment - Fetching config from server at : http://config-service
06:04:30.135 [serviceId:xxx-service/traceId:545d584f10da3123/spanId:545d584f10da3123/parentId:] INFO  o.s.c.c.c.ConfigServicePropertySourceLocator.log - Located environment: name=xxxservice, profiles=[dev], label=master, version=00ed4aebcd466c88b4a7df61296652944642cdc8, state=null
06:09:30.367 [serviceId:xxx-service/traceId:519fdde3a2d8ce5a/spanId:519fdde3a2d8ce5a/parentId:] INFO  o.s.c.c.c.ConfigServicePropertySourceLocator.getRemoteEnvironment - Fetching config from server at : http://config-service
06:09:31.928 [serviceId:xxx-service/traceId:519fdde3a2d8ce5a/spanId:519fdde3a2d8ce5a/parentId:] INFO  o.s.c.c.c.ConfigServicePropertySourceLocator.log - Located environment: name=xxxservice, profiles=[dev], label=master, version=00ed4aebcd466c88b4a7df61296652944642cdc8, state=null
06:14:32.035 [serviceId:xxx-service/traceId:e32c45c3a5c3fcca/spanId:e32c45c3a5c3fcca/parentId:] INFO  o.s.c.c.c.ConfigServicePropertySourceLocator.getRemoteEnvironment - Fetching config from server at : http://config-service
06:14:33.611 [serviceId:xxx-service/traceId:e32c45c3a5c3fcca/spanId:e32c45c3a5c3fcca/parentId:] INFO  o.s.c.c.c.ConfigServicePropertySourceLocator.log - Located environment: name=xxxservice, profiles=[dev], label=master, version=00ed4aebcd466c88b4a7df61296652944642cdc8, state=null
06:19:32.033 [serviceId:xxx-service/traceId:16fc982b0638d4a6/spanId:16fc982b0638d4a6/parentId:] INFO  o.s.c.c.c.ConfigServicePropertySourceLocator.getRemoteEnvironment - Fetching config from server at : http://config-service
06:19:33.495 [serviceId:xxx-service/traceId:16fc982b0638d4a6/spanId:16fc982b0638d4a6/parentId:] INFO  o.s.c.c.c.ConfigServicePropertySourceLocator.log - Located environment: name=xxxservice, profiles=[dev], label=master, version=00ed4aebcd466c88b4a7df61296652944642cdc8, state=null
06:24:32.036 [serviceId:xxx-service/traceId:f4eae364e2624d58/spanId:f4eae364e2624d58/parentId:] INFO  o.s.c.c.c.ConfigServicePropertySourceLocator.getRemoteEnvironment - Fetching config from server at : http://config-service
06:24:33.640 [serviceId:xxx-service/traceId:f4eae364e2624d58/spanId:f4eae364e2624d58/parentId:] INFO  o.s.c.c.c.ConfigServicePropertySourceLocator.log - Located environment: name=xxxservice, profiles=[dev], label=master, version=00ed4aebcd466c88b4a7df61296652944642cdc8, state=null
spring:
  profiles:
    active: dev
  cloud:
    config:
      name: xxxservice
      label: master
      uri: http://config-service
    null

共有1个答案

南宫勇军
2023-03-14

我不知道为什么您在其他服务中没有看到这种情况,但我认为这种行为是由于客户机希望定期检查服务器的健康状况。来自Spring Cloud Config客户端文档:

7.8.1健康指标

配置客户端提供一个尝试从配置服务器加载配置的Spring Boot Health指示器。可以通过设置health.config.enabled=false来禁用健康指示器。由于性能原因,响应也被缓存。默认的缓存生存时间是5分钟。若要更改该值,请设置Health.config.time-to-live属性(以毫秒为单位)。

 类似资料:
  • 我有一个web应用程序,我想使用Spring Boot的服务器配置。这两个应用程序都位于本地主机上。我从头开始创建了前两个应用程序,它们一起工作,但当我使用具有许多依赖项(不仅仅是云配置和web依赖项)的客户端时,它就不再工作了。我怎么知道?我在服务器的属性文件中有一个变量,我试图在我的客户机中用@Value(“${atena}”)来使用它,错误出现在java中。lang.IllegalArgum

  • 我想在应用程序配置服务中检索Azure密钥库引用的秘密。在dotnet中,这是小菜一碟,只需添加Options.configureKeyVault,就可以像下面这样检索secret: 但是在Python中,我没有找到任何方法可以在AzureAppConfigurationClient中添加KeyVault处理,当您试图检索KeyVault引用的secret时,您只需要得到字符串: 。 我已经“解决

  • 我已在单独的Weblogic域中成功配置了SAML 2.0身份提供程序 我们在另一个域的Weblogic中部署了一个ADF应用程序,该应用程序具有非SAML基于表单的身份验证(ReadOnlySQLAuthenticator用于验证凭据) 我想将第二个域配置为服务提供者(以使现有应用程序能够使用身份提供者登录)。 我做了以下工作: 配置SAML 2.0 Identity Asserter 在服务器

  • 简短版本:Symfony服务配置做什么? 最近,在Symfony项目中工作时,我在文件中输入了无效的服务定义。我收到了这个非常有用的错误消息 配置键"foo"不支持"/用户/alanStorm/站点/symfony-4/my-project/config/services.yaml"中的定义"App\Services\ServiceA"。允许的配置键是"别名"、"父"、"类"、"共享"、"合成"、

  • 看这个教程,很清楚的介绍了iOS证书申请流程http://kxdang.com/topic/appuploader/certification.html

  • 当我运行Spring Cloud Config Client项目config-client时,我发现了以下错误: 启动ApplicationContext时出错。若要显示自动配置报告,请在启用“debug”的情况下重新运行应用程序。2018-02-09 10:31:10.923错误13933--[main]O.S.Boot.SpringApplication:应用程序启动失败 显然,配置服务器是错

  • 还有什么方法可以让spring cloud配置客户端的应用程序。yml从spring配置服务器读取值?例如,在我的spring cloud config客户端上,应用程序。yml就是这样 还有我的引导程序。yml文件如下所示 对于服务url值,对于不同的环境,我必须配置不同的eureka url值,我的问题是,我是否可以在配置服务器中配置服务url值?就像我在应用程序中将值设置为${service

  • 我正在努力弄清楚我为React应用程序配置Firebase的尝试出了什么问题。我已经遵循了至少10个不同的教程,但无法让配置变量注册为已识别的。 然后,我有一个firebase/firebase.js文件,如下所示: 我一直试图弄清楚为什么配置变量被记录为未定义。 有没有人知道如何成功配置一个firebase应用程序。我之前关于这个主题的问题建议删除env.development文件中的:和值之间