Skip to content

Commit

Permalink
Update Consul Client to expose deprecated Consul API (#29288)
Browse files Browse the repository at this point in the history
  • Loading branch information
linghengqian authored Dec 5, 2023
1 parent cb0cf03 commit b96b0d4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
6 changes: 6 additions & 0 deletions mode/type/cluster/repository/provider/consul/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -42,7 +41,7 @@ public List<String> toUrlParameters() {
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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -133,7 +133,7 @@ private long waitUntilRelease(final long valueIndex, final long timeoutMillis) {
}
}

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>>() {
});
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit b96b0d4

Please sign in to comment.