You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2018/05/21 06:33:23 UTC

[incubator-servicecomb-java-chassis] branch master updated (0f569c2 -> 5fc99f5)

This is an automated email from the ASF dual-hosted git repository.

liubao pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git.


    from 0f569c2  [SCB-582]only protect empty instances and make this behavior default
     new a3eb984  [SCB-591] configcenter need to do encode
     new f676a76  [SCB-591] configcenter need to do encode,modify
     new 5fc99f5  [SCB-591] configcenter need to do encode,modify do encode fail

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/servicecomb/config/client/ConfigCenterClient.java   | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

-- 
To stop receiving notification emails like this one, please contact
liubao@apache.org.

[incubator-servicecomb-java-chassis] 01/03: [SCB-591] configcenter need to do encode

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit a3eb984e7a6f57d7b6b38d18d171f9b668dac691
Author: weichao666 <we...@huawei.com>
AuthorDate: Thu May 17 21:41:46 2018 +0800

    [SCB-591] configcenter need to do encode
---
 .../org/apache/servicecomb/config/client/ConfigCenterClient.java  | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java b/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
index aaef866..c2b31a2 100644
--- a/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
+++ b/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
@@ -329,8 +329,14 @@ public class ConfigCenterClient {
 
     public void refreshConfig(String configcenter, boolean wait) {
       CountDownLatch latch = new CountDownLatch(1);
+      String encodeServiceName = "";
+      try {
+        encodeServiceName = URLEncoder.encode(serviceName, "UTF-8");
+      } catch (UnsupportedEncodingException e1) {
+        e1.printStackTrace();
+      }
+      String path = URIConst.ITEMS + "?dimensionsInfo=" + StringUtils.deleteWhitespace(encodeServiceName);
       clientMgr.findThreadBindClientPool().runOnContext(client -> {
-        String path = URIConst.ITEMS + "?dimensionsInfo=" + StringUtils.deleteWhitespace(serviceName);
         IpPort ipPort = NetUtils.parseIpPortFromURI(configcenter);
         HttpClientRequest request = client.get(ipPort.getPort(), ipPort.getHostOrIp(), path, rsp -> {
           if (rsp.statusCode() == HttpResponseStatus.OK.code()) {

-- 
To stop receiving notification emails like this one, please contact
liubao@apache.org.

[incubator-servicecomb-java-chassis] 02/03: [SCB-591] configcenter need to do encode, modify

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit f676a760ab5e84a3a1fcafa7ea1981c63aae474c
Author: weichao666 <we...@huawei.com>
AuthorDate: Fri May 18 09:13:04 2018 +0800

    [SCB-591] configcenter need to do encode,modify
---
 .../org/apache/servicecomb/config/client/ConfigCenterClient.java  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java b/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
index c2b31a2..ca9d118 100644
--- a/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
+++ b/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
@@ -331,11 +331,11 @@ public class ConfigCenterClient {
       CountDownLatch latch = new CountDownLatch(1);
       String encodeServiceName = "";
       try {
-        encodeServiceName = URLEncoder.encode(serviceName, "UTF-8");
-      } catch (UnsupportedEncodingException e1) {
-        e1.printStackTrace();
+        encodeServiceName = URLEncoder.encode(StringUtils.deleteWhitespace(serviceName), "UTF-8");
+      } catch (UnsupportedEncodingException e) {
+        LOGGER.error("encode error: {}",e.getMessage());
       }
-      String path = URIConst.ITEMS + "?dimensionsInfo=" + StringUtils.deleteWhitespace(encodeServiceName);
+      String path = URIConst.ITEMS + "?dimensionsInfo=" + encodeServiceName;
       clientMgr.findThreadBindClientPool().runOnContext(client -> {
         IpPort ipPort = NetUtils.parseIpPortFromURI(configcenter);
         HttpClientRequest request = client.get(ipPort.getPort(), ipPort.getHostOrIp(), path, rsp -> {

-- 
To stop receiving notification emails like this one, please contact
liubao@apache.org.

[incubator-servicecomb-java-chassis] 03/03: [SCB-591] configcenter need to do encode, modify do encode fail

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit 5fc99f58bdd5e9d91e995da596116c30705aca3b
Author: weichao666 <we...@huawei.com>
AuthorDate: Mon May 21 11:17:21 2018 +0800

    [SCB-591] configcenter need to do encode,modify do encode fail
---
 .../org/apache/servicecomb/config/client/ConfigCenterClient.java    | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java b/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
index ca9d118..9b78429 100644
--- a/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
+++ b/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
@@ -23,6 +23,7 @@ import java.io.UnsupportedEncodingException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -331,9 +332,10 @@ public class ConfigCenterClient {
       CountDownLatch latch = new CountDownLatch(1);
       String encodeServiceName = "";
       try {
-        encodeServiceName = URLEncoder.encode(StringUtils.deleteWhitespace(serviceName), "UTF-8");
+        encodeServiceName = URLEncoder.encode(StringUtils.deleteWhitespace(serviceName), StandardCharsets.UTF_8.name());
       } catch (UnsupportedEncodingException e) {
-        LOGGER.error("encode error: {}",e.getMessage());
+        LOGGER.error("encode failed. Error message: {}", e.getMessage());
+        encodeServiceName = StringUtils.deleteWhitespace(serviceName);
       }
       String path = URIConst.ITEMS + "?dimensionsInfo=" + encodeServiceName;
       clientMgr.findThreadBindClientPool().runOnContext(client -> {

-- 
To stop receiving notification emails like this one, please contact
liubao@apache.org.