You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2019/12/30 01:54:19 UTC

[GitHub] [servicecomb-java-chassis] liubao68 edited a comment on issue #1501: SpringBoot+CSE开发的微服务,通过配置文件获取配置有问题

liubao68 edited a comment on issue #1501: SpringBoot+CSE开发的微服务,通过配置文件获取配置有问题
URL: https://github.com/apache/servicecomb-java-chassis/issues/1501#issuecomment-569562302
 
 
   1, 2 种情况是yaml和spring boot解析数组类型差异导致的,一个当成数组,一个当成String进行读取了。建议符合他们的默认行为,避免混用。 比如,对于Spring Boot集成java-chassis的场景(包括standalone和servlet两种集成方式),遵循Spring Boot的规范,都使用application.yml,所有的配置项都写到application.yml,不额外提供microservcie.yaml文件; 对应的,对于不使用Spring Boot集成的场景,只使用microservice.yaml作为配置文件。 
   
   yaml的数组处理的行为目前看确实不怎么好,增加了理解的难度。建议使用前测试好,测试好后行为是不会变的。 但是不能靠经验,配置的地方变化了,行为就变化了,以前在实现这部分代码的时候(选择getStringArray读取,而不是getString读取,然后split),也发现很奇怪。 
   
   BTW:你测试的没问题的方式,是推荐的使用方式。

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services