Uploaded image for project: 'Apache ServiceComb'
  1. Apache ServiceComb
  2. SCB-638

create mechanism for read config item by priority

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Done
    • None
    • java-chassis-1.2.0
    • Java-Chassis
    • None

    Description

      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:

       

      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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            wujimin Jimin Wu
            wujimin Jimin Wu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0h
              0h
              Logged:
              Time Spent - 40m
              40m

              Slack

                Issue deployment