apolloconfig/apollo

properties配置类型返回顺序乱序

yunnian opened this issue · 7 comments

properties配置类型的配置,用openapi请求或者长轮训的方式拿到的json configurations里的值是乱序的

目前是不会刻意保证配置的顺序的,目前保证的是配置集合的完整性和正确性

但是spring 从properties文件中读取到的是按配置顺序的,apollo则无序,这块能不能考虑支持下。对于拦截链的配置还是比较关键的,谢谢

这里分为两块,服务端发布的配置可以通过简单的修改为LinkedHashMap来实现,不过客户端最终是使用Properties来存储配置的,而Properties继承自Hashtable,所以默认会重新排序的,不知是否有啥好的建议?

@nobodyiam 就譬如 #2451 就是一个实际的例子,zuul的路由映射底层是LinkedHashMap结构但是apollo推过来之后就乱序了,能不能搞一个有序的命名空间,我只是简单这样想,那么需要有序的配置就可以做成这种命名空间,然后使用关联的方式指定。

同样的顺序问题 比如Druid的
maxEvictableIdleTimeMillis 和 minEvictableIdleTimeMillis 2个属性
setMaxEvictableIdleTimeMillis 会检查是否比minEvictableIdleTimeMillis小
如果先setMax 就会出错 很蛋疼

stale commented

This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed in 14 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.

stale commented

This issue has been automatically closed because it has not had activity in the last 14 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.