fix:fix consul host with scheme bug.

pull/77/head
skyehtzhang 3 years ago
parent 9f5bc3b0b7
commit 6735d125bc

@ -17,13 +17,11 @@
package com.tencent.cloud.polaris.util; package com.tencent.cloud.polaris.util;
import java.util.Map;
import java.util.Objects;
import com.squareup.okhttp.MediaType;
import com.squareup.okhttp.OkHttpClient; import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request; import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response; import com.squareup.okhttp.Response;
import java.util.Map;
import java.util.Objects;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -39,12 +37,6 @@ public final class OkHttpUtil {
*/ */
public final static Logger logger = LoggerFactory.getLogger(OkHttpUtil.class); public final static Logger logger = LoggerFactory.getLogger(OkHttpUtil.class);
/**
* JSON format.
*/
public static final MediaType MEDIA_TYPE_JSON = MediaType
.parse("application/json; charset=utf-8");
/** /**
* client. * client.
*/ */

@ -17,10 +17,6 @@
package com.tencent.cloud.polaris.router; package com.tencent.cloud.polaris.router;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.netflix.client.config.IClientConfig; import com.netflix.client.config.IClientConfig;
import com.netflix.loadbalancer.DynamicServerListLoadBalancer; import com.netflix.loadbalancer.DynamicServerListLoadBalancer;
import com.netflix.loadbalancer.IPing; import com.netflix.loadbalancer.IPing;
@ -41,8 +37,10 @@ import com.tencent.polaris.api.pojo.ServiceKey;
import com.tencent.polaris.router.api.core.RouterAPI; import com.tencent.polaris.router.api.core.RouterAPI;
import com.tencent.polaris.router.api.rpc.ProcessRoutersRequest; import com.tencent.polaris.router.api.rpc.ProcessRoutersRequest;
import com.tencent.polaris.router.api.rpc.ProcessRoutersResponse; import com.tencent.polaris.router.api.rpc.ProcessRoutersResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
/** /**
@ -114,8 +112,7 @@ public class PolarisRoutingLoadBalancer extends DynamicServerListLoadBalancer<Se
serviceInfo.setMetadata(transitiveCustomMetadata); serviceInfo.setMetadata(transitiveCustomMetadata);
processRoutersRequest.setSourceService(serviceInfo); processRoutersRequest.setSourceService(serviceInfo);
} }
ProcessRoutersResponse processRoutersResponse = routerAPI ProcessRoutersResponse processRoutersResponse = routerAPI.processRouters(processRoutersRequest);
.processRouters(processRoutersRequest);
ServiceInstances filteredServiceInstances = processRoutersResponse ServiceInstances filteredServiceInstances = processRoutersResponse
.getServiceInstances(); .getServiceInstances();
List<Server> filteredInstances = new ArrayList<>(); List<Server> filteredInstances = new ArrayList<>();

@ -63,7 +63,7 @@
<properties> <properties>
<revision>1.2.0-Hoxton.SR9-SNAPSHOT</revision> <revision>1.2.0-Hoxton.SR9-SNAPSHOT</revision>
<polaris.version>1.3.0</polaris.version> <polaris.version>1.3.1</polaris.version>
<powermock.version>2.0.0</powermock.version> <powermock.version>2.0.0</powermock.version>
<!-- Maven Plugin Versions --> <!-- Maven Plugin Versions -->

Loading…
Cancel
Save