From eed66464ba8ace4b73c43087e9f0328123f1c67f Mon Sep 17 00:00:00 2001 From: chuntaojun Date: Mon, 3 Apr 2023 19:46:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:gateway=E6=94=AF=E6=8C=81=E4=B8=8A?= =?UTF-8?q?=E6=8A=A5=E8=B0=83=E7=94=A8=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../util/PolarisCircuitBreakerUtils.java | 9 -------- .../util/PolarisCircuitBreakerUtilsTests.java | 22 +++++++++++++++++++ 2 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 spring-cloud-starter-tencent-polaris-circuitbreaker/src/test/java/com/tencent/cloud/polaris/circuitbreaker/util/PolarisCircuitBreakerUtilsTests.java diff --git a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/util/PolarisCircuitBreakerUtils.java b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/util/PolarisCircuitBreakerUtils.java index c1af4af22..4c7502c92 100644 --- a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/util/PolarisCircuitBreakerUtils.java +++ b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/util/PolarisCircuitBreakerUtils.java @@ -26,8 +26,6 @@ import com.tencent.polaris.api.pojo.RetStatus; import com.tencent.polaris.api.pojo.ServiceKey; import com.tencent.polaris.api.rpc.ServiceCallResult; import com.tencent.polaris.circuitbreak.client.exception.CallAbortedException; -import com.tencent.polaris.discovery.client.api.DefaultConsumerAPI; -import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -79,13 +77,6 @@ public final class PolarisCircuitBreakerUtils { if (Objects.nonNull(e.getFallbackInfo())) { result.setRetCode(e.getFallbackInfo().getCode()); } - - String callerIp = ((DefaultConsumerAPI) consumerAPI).getSDKContext().getConfig().getGlobal().getAPI() - .getBindIP(); - if (StringUtils.isNotBlank(callerIp)) { - result.setCallerIp(callerIp); - } - consumerAPI.updateServiceCallResult(result); } catch (Throwable ex) { diff --git a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/test/java/com/tencent/cloud/polaris/circuitbreaker/util/PolarisCircuitBreakerUtilsTests.java b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/test/java/com/tencent/cloud/polaris/circuitbreaker/util/PolarisCircuitBreakerUtilsTests.java new file mode 100644 index 000000000..c098b22d8 --- /dev/null +++ b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/test/java/com/tencent/cloud/polaris/circuitbreaker/util/PolarisCircuitBreakerUtilsTests.java @@ -0,0 +1,22 @@ +/* + * Tencent is pleased to support the open source community by making Spring Cloud Tencent available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * + * Licensed under the BSD 3-Clause License (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://opensource.org/licenses/BSD-3-Clause + * + * Unless required by applicable law or agreed to in writing, software distributed + * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.tencent.cloud.polaris.circuitbreaker.util; + +public class PolarisCircuitBreakerUtilsTests { + +}