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

zhaojinchao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new b96b0d4c212 Update Consul Client to expose deprecated Consul API 
(#29288)
b96b0d4c212 is described below

commit b96b0d4c2120f64d0fcd67166f1229c327a15792
Author: Ling Hengqian <[email protected]>
AuthorDate: Tue Dec 5 13:21:09 2023 +0800

    Update Consul Client to expose deprecated Consul API (#29288)
---
 mode/type/cluster/repository/provider/consul/pom.xml                | 6 ++++++
 .../mode/repository/cluster/consul/ShardingSphereQueryParams.java   | 3 +--
 .../mode/repository/cluster/consul/lock/ConsulDistributedLock.java  | 4 ++--
 pom.xml                                                             | 4 ++--
 4 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/mode/type/cluster/repository/provider/consul/pom.xml 
b/mode/type/cluster/repository/provider/consul/pom.xml
index ef9be694cd1..641b2d2162c 100644
--- a/mode/type/cluster/repository/provider/consul/pom.xml
+++ b/mode/type/cluster/repository/provider/consul/pom.xml
@@ -32,6 +32,12 @@
                 <groupId>com.ecwid.consul</groupId>
                 <artifactId>consul-api</artifactId>
                 <version>${consul.api.version}</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>org.apache.httpcomponents</groupId>
+                        <artifactId>httpcore</artifactId>
+                    </exclusion>
+                </exclusions>
             </dependency>
             <dependency>
                 <groupId>org.apache.httpcomponents</groupId>
diff --git 
a/mode/type/cluster/repository/provider/consul/src/main/java/org/apache/shardingsphere/mode/repository/cluster/consul/ShardingSphereQueryParams.java
 
b/mode/type/cluster/repository/provider/consul/src/main/java/org/apache/shardingsphere/mode/repository/cluster/consul/ShardingSphereQueryParams.java
index f1110840f0b..80715ffb5af 100644
--- 
a/mode/type/cluster/repository/provider/consul/src/main/java/org/apache/shardingsphere/mode/repository/cluster/consul/ShardingSphereQueryParams.java
+++ 
b/mode/type/cluster/repository/provider/consul/src/main/java/org/apache/shardingsphere/mode/repository/cluster/consul/ShardingSphereQueryParams.java
@@ -18,7 +18,6 @@
 package org.apache.shardingsphere.mode.repository.cluster.consul;
 
 import com.ecwid.consul.UrlParameters;
-import com.ecwid.consul.Utils;
 import lombok.RequiredArgsConstructor;
 
 import java.util.ArrayList;
@@ -42,7 +41,7 @@ public final class ShardingSphereQueryParams implements 
UrlParameters {
             result.add(String.format("wait=%dms", 
TimeUnit.MILLISECONDS.toMillis(waitMillis)));
         }
         if (-1 != index) {
-            result.add(String.format("index=%s", 
Utils.toUnsignedString(index)));
+            result.add(String.format("index=%s", 
Long.toUnsignedString(index)));
         }
         return result;
     }
diff --git 
a/mode/type/cluster/repository/provider/consul/src/main/java/org/apache/shardingsphere/mode/repository/cluster/consul/lock/ConsulDistributedLock.java
 
b/mode/type/cluster/repository/provider/consul/src/main/java/org/apache/shardingsphere/mode/repository/cluster/consul/lock/ConsulDistributedLock.java
index 18c43de83aa..a91b8130243 100644
--- 
a/mode/type/cluster/repository/provider/consul/src/main/java/org/apache/shardingsphere/mode/repository/cluster/consul/lock/ConsulDistributedLock.java
+++ 
b/mode/type/cluster/repository/provider/consul/src/main/java/org/apache/shardingsphere/mode/repository/cluster/consul/lock/ConsulDistributedLock.java
@@ -18,7 +18,7 @@
 package org.apache.shardingsphere.mode.repository.cluster.consul.lock;
 
 import com.ecwid.consul.ConsulException;
-import com.ecwid.consul.transport.RawResponse;
+import com.ecwid.consul.transport.HttpResponse;
 import com.ecwid.consul.v1.ConsulClient;
 import com.ecwid.consul.v1.OperationException;
 import com.ecwid.consul.v1.QueryParams;
@@ -133,7 +133,7 @@ public final class ConsulDistributedLock implements 
DistributedLock {
         }
     }
     
-    private Response<GetValue> getResponse(final RawResponse rawResponse) {
+    private Response<GetValue> getResponse(final HttpResponse rawResponse) {
         if (200 == rawResponse.getStatusCode()) {
             List<GetValue> value = 
JsonUtils.fromJsonString(rawResponse.getContent(), new 
TypeReference<List<GetValue>>() {
             });
diff --git a/pom.xml b/pom.xml
index 75556ef6199..dea546a1551 100644
--- a/pom.xml
+++ b/pom.xml
@@ -106,11 +106,11 @@
         <zookeeper.version>3.9.0</zookeeper.version>
         <audience-annotations.version>0.12.0</audience-annotations.version>
         <jetcd.version>0.7.6</jetcd.version>
-        <consul.api.version>1.4.1</consul.api.version>
+        <consul.api.version>1.4.5</consul.api.version>
         
         <grpc.version>1.58.0</grpc.version>
         <protobuf.version>3.21.12</protobuf.version>
-        <httpclient.version>4.5.13</httpclient.version>
+        <httpclient.version>4.5.14</httpclient.version>
         <okhttp.version>4.12.0</okhttp.version>
         
         <elasticjob.version>3.0.4</elasticjob.version>

Reply via email to