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 2021/02/25 09:15:58 UTC

[GitHub] [servicecomb-java-chassis] kaister3 opened a new pull request #2253: [SCB-2187]support dynamic key values as yaml source

kaister3 opened a new pull request #2253:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2253


   
   


----------------------------------------------------------------
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



[GitHub] [servicecomb-java-chassis] liubao68 commented on a change in pull request #2253: [SCB-2187]support dynamic key values as yaml source

Posted by GitBox <gi...@apache.org>.
liubao68 commented on a change in pull request #2253:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2253#discussion_r583319143



##########
File path: demo/demo-springmvc/springmvc-server/src/main/resources/microservice.yaml
##########
@@ -47,10 +47,11 @@ servicecomb:
   # can download config center from https://cse-bucket.obs.myhwclouds.com/LocalCSE/Local-CSE-1.0.0.zip to test dynamic config
   config:
     client:
-  #    serverUri: http://127.0.0.1:30113
+      serverUri: http://127.0.0.1:30115

Review comment:
       This test is an auto-test in docker and no config center installed. So you can not submit this test code.  
   After you finished your local test, you can add test cases without config center. For example, add yaml files to `microservice.yaml`
   
   ```
   mytest:
     yaml: |
         hostName: wyk
   ```




----------------------------------------------------------------
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



[GitHub] [servicecomb-java-chassis] liubao68 commented on a change in pull request #2253: [SCB-2187]support dynamic key values as yaml source

Posted by GitBox <gi...@apache.org>.
liubao68 commented on a change in pull request #2253:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2253#discussion_r583321008



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterConfig.java
##########
@@ -71,6 +81,40 @@ private ConfigCenterConfig() {
 
   public static void setConcurrentCompositeConfiguration(ConcurrentCompositeConfiguration config) {
     finalConfig = config;
+    readFileSourceConfig();
+  }
+
+  @SuppressWarnings("unchecked")
+  public List<String> getFileSource() {
+    return (List<String>) finalConfig.getProperty(FILE_SOURCE);
+  }
+
+  private static void readFileSourceConfig() {

Review comment:
       This PR is not correct. We are not going to support config yaml files. But config yaml contents in config center. Using your test case for example. 
   
   mytest.yaml is a key in config center, and the value of mytest.yaml is the file content. 
   
   




----------------------------------------------------------------
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



[GitHub] [servicecomb-java-chassis] kaister3 closed pull request #2253: [SCB-2187]support dynamic key values as yaml source

Posted by GitBox <gi...@apache.org>.
kaister3 closed pull request #2253:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2253


   


----------------------------------------------------------------
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



[GitHub] [servicecomb-java-chassis] liubao68 commented on a change in pull request #2253: [SCB-2187]support dynamic key values as yaml source

Posted by GitBox <gi...@apache.org>.
liubao68 commented on a change in pull request #2253:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2253#discussion_r583319656



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterConfig.java
##########
@@ -17,13 +17,21 @@
 
 package org.apache.servicecomb.config.client;
 
-import java.util.List;
+import com.google.common.base.Joiner;
+import com.netflix.config.ConcurrentCompositeConfiguration;
+
+import java.util.*;
+import java.io.*;
+import java.net.*;

Review comment:
       Using `ctrl+alt+o` to organize imports. Do not use imortp x.x.*;




----------------------------------------------------------------
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



[GitHub] [servicecomb-java-chassis] kaister3 commented on a change in pull request #2253: [SCB-2187]support dynamic key values as yaml source

Posted by GitBox <gi...@apache.org>.
kaister3 commented on a change in pull request #2253:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2253#discussion_r584496717



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterConfig.java
##########
@@ -71,6 +81,40 @@ private ConfigCenterConfig() {
 
   public static void setConcurrentCompositeConfiguration(ConcurrentCompositeConfiguration config) {
     finalConfig = config;
+    readFileSourceConfig();
+  }
+
+  @SuppressWarnings("unchecked")
+  public List<String> getFileSource() {
+    return (List<String>) finalConfig.getProperty(FILE_SOURCE);
+  }
+
+  private static void readFileSourceConfig() {

Review comment:
       roger that




----------------------------------------------------------------
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