[ https://issues.apache.org/jira/browse/SCB-638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16510566#comment-16510566 ]
wujimin commented on SCB-638: ----------------------------- logic of install config is confusion, need to be refactor: load and install configuration sources by SPI getOrder, not hard code as currently map "cse" to "servicecomb" is a configuration source too mappings is also a configuration source > create mechanism for read config item by priority > -------------------------------------------------- > > Key: SCB-638 > URL: https://issues.apache.org/jira/browse/SCB-638 > Project: Apache ServiceComb > Issue Type: Task > Components: Java-Chassis > Reporter: wujimin > Assignee: wujimin > Priority: Major > > currently, we have so many config item need to read by priority. > 1.read operation level > 2.if operation level not exist, then read schema level > 3.if schema level not exist, then read microservice level > 4.if microservice level not exist, then read global level (only for consumer) > > everyone repeated the logic, and try all the level for every invocation > we can provide a mechanism to handle this logic, eg: > > {code:java} > class XxxConfig{ > @Config(prefix="servicecomb.request.time") > private int timeout; > ...... > } > OperationMeta.extData changed from ConcurrentHashMap to ConcurrentHashMapEx > XxxConfig config = operationMeta.getExtData().computeIfAbsent("...", > k->ConfigFactory.create(operationMeta)); > config.getTimeout() // this is what we want. all try logic is > triggered by config change callback, not run for every invocation.{code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)