java - Spring Cloud Config 的大小限制是多少?
问题描述
我们正在使用 Spring Boot、Spring Cloud 配置并从外部源生成 application.yaml。这个 yaml 文件有大约 53k 行配置,文件大小为 2.7mb。不幸的是,当连接到这个配置时,spring 应用程序无法启动。
我设法将 yaml 文件输入本地 Spring Cloud Config 服务器,并通过 http://localhost:8888/mybranch/myApp-application.properties 之类的 url 请求表示。
但是当我通过它启动我的 Spring Boot 应用程序时,mvn clean spring-boot:run -Dspring-boot.run.profiles=local
它会在启动过程中停止。
事实上,它在从云配置服务器获取 yaml后停止。如您所见,初始化过滤器“apiKeyHeaderFilter”大约需要 2 分钟。但在那之后它停止了。
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.0.3.RELEASE)
2019-03-28 21:06:01.264 INFO 43213 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at : http://localhost:8888
2019-03-28 21:06:05.129 INFO 43213 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Located environment: name=myApp, profiles=[local], label=mybranch, version=99fd22b9273e757c2afad36deec40442c2cdb69a, state=null
2019-03-28 21:06:05.130 INFO 43213 --- [ main] b.c.PropertySourceBootstrapConfiguration : Located property source: CompositePropertySource {name='configService', propertySources=[MapPropertySource {name='configClient'}, MapPropertySource {name='/Users/me/dev/projects/mam/repos/myApp-configs/application.yaml'}]}
2019-03-28 21:06:10.506 INFO 43213 --- [ main] c.m.forms.application.Application : The following profiles are active: local
2019-03-28 21:08:04.864 DEBUG 43213 --- [ost-startStop-1] c.m.m.c.a.ApiKeyHeaderFilter : Initializing filter 'apiKeyHeaderFilter'
2019-03-28 21:08:04.865 DEBUG 43213 --- [ost-startStop-1] c.m.m.c.a.ApiKeyHeaderFilter : Filter 'apiKeyHeaderFilter' configured successfully
我已经尝试从具有更大堆大小但结果相同的应用程序开始:mvn clean spring-boot:run -Dspring-boot.run.profiles=local -Drun.jvmArguments="-Xms1024m"
我的设置是否达到了大小限制或配置阈值行?
编辑: myApp 的相关部分也bootstrap.yaml
如下所示:
spring:
profiles: local
cloud:
config:
enabled: true
label: mybranch
uri: http://localhost:8888
解决方案
推荐阅读
- flutter - 如何测试电子邮件应用程序打开的颤振 url_launcher?
- android - 合并两个可观察对象的正确 Rx 操作
- html - 为什么悬停时我的代码中的转换不起作用?
- node.js - 使用nodejs归档器下载多个谷歌云存储文件并压缩它们
- typescript - Firestore 在对象数组字段中查找具有特定对象的文档
- c# - 如何将文本框中的值乘以数组中的其他值(C#)
- python - Google Analytics 和 Python - 授权墙
- nginx - 根据主机重写 url
- python - 这个技巧如何通过删除 C 库来暴露 Python 库?(允许猴子修补 ElementTree)
- javascript - 浏览器扩展仅替换为 1img