我们正在使用Spring Boot,Spring Cloud Configurations并从外部源生成application.yaml。这个yaml文件的配置行数约为53k,文件大小为2.7mb。不幸的是,连接到此配置后,spring应用程序无法启动。
我设法将yaml文件输入到本地的Spring Cloud Config服务器中,并通过类似url的请求 http://localhost:8888/mybranch/myApp-application.properties。
但是,当我通过mvn clean spring-boot:run -Dspring-boot.run.profiles=local
启动Spring Boot应用程序时,它会在启动过程中停止。
实际上,它是在从云配置服务器中获取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