kezhenxu94 commented on a change in pull request #3367: agent support custom 
properties.
URL: https://github.com/apache/skywalking/pull/3367#discussion_r324718786
 
 

 ##########
 File path: 
oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2MetadataQueryDAO.java
 ##########
 @@ -280,26 +282,32 @@ public Service searchService(String serviceCode) throws 
IOException {
                     String propertiesString = 
resultSet.getString(ServiceInstanceInventory.PROPERTIES);
                     if (!Strings.isNullOrEmpty(propertiesString)) {
                         JsonObject properties = 
GSON.fromJson(propertiesString, JsonObject.class);
-                        if (properties.has(LANGUAGE)) {
-                            
serviceInstance.setLanguage(LanguageTrans.INSTANCE.value(properties.get(LANGUAGE).getAsString()));
-                        } else {
-                            serviceInstance.setLanguage(Language.UNKNOWN);
-                        }
+                        for (Map.Entry<String, JsonElement> property : 
properties.entrySet()) {
+                            String key = property.getKey();
+                            String value = property.getValue().getAsString();
+                            if (key.equals(LANGUAGE)) {
+                                
serviceInstance.setLanguage(LanguageTrans.INSTANCE.value(value));
+                            } else {
+                                serviceInstance.setLanguage(Language.UNKNOWN);
 
 Review comment:
   Same here

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to