3

We are using Spring Boot, Spring Cloud Configurations and generate the application.yaml from an external source. This yaml file has about 53k lines of configuration and a file size of 2.7mb. Unfortunately, the spring application fails starting when connected to this config.

I managed to feed the yaml file into the Spring Cloud Config server locally and request a representation via a url like http://localhost:8888/mybranch/myApp-application.properties.

But when I start my Spring Boot app via mvn clean spring-boot:run -Dspring-boot.run.profiles=local it stops in the middle of the boot process.

In fact it stops after fetching the yaml from the cloud config server. As you can see it takes about 2 minutes to initialize the filter 'apiKeyHeaderFilter'. But after that it stops.

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: 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 

I already tried starting with the app with more heap size but same result: mvn clean spring-boot:run -Dspring-boot.run.profiles=local -Drun.jvmArguments="-Xms1024m"

Do I hit a size limitation or lines of config threshold with my setup?

Edit: Also the relevant part of myApp bootstrap.yaml looks like the following:

spring:
  profiles: local
  cloud:
    config:
      enabled: true
      label: mybranch
      uri: http://localhost:8888
M. Schmidt
  • 53
  • 6
  • Are you sure you setup config file correctly for your local env? – MS90 Mar 28 '19 at 20:47
  • Hi @MS90: When you say "setup config file" you probably refer to the `bootstrap.yaml` in the Spring Boot app, right? I am able to see the properties file via request to localhost after all. I firmly believe, the bootstrap is correct as I was able to change this to a different label and address a shorter application.yaml in a different branch. Let me edit the main post and add an extraction of the bootstrap.yaml. – M. Schmidt Mar 28 '19 at 21:47

0 Answers0