From 90d6823693481e835fc9440a6cf7aad23838d9eb Mon Sep 17 00:00:00 2001 From: tanghc Date: Wed, 21 Aug 2019 14:41:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E9=9D=A2=E4=BD=BF=E7=94=A8nacos?= =?UTF-8?q?=EF=BC=8C=E8=88=8D=E5=BC=83zookeeper?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gateway/route/GatewayRouteRepository.java | 2 ++ .../src/main/resources/application-dev.properties | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/route/GatewayRouteRepository.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/route/GatewayRouteRepository.java index da185871..27d8a26e 100644 --- a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/route/GatewayRouteRepository.java +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/route/GatewayRouteRepository.java @@ -4,6 +4,7 @@ import com.gitee.sop.gatewaycommon.bean.GatewayRouteDefinition; import com.gitee.sop.gatewaycommon.bean.TargetRoute; import com.gitee.sop.gatewaycommon.manager.RouteRepository; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.cloud.gateway.event.PredicateArgsEvent; import org.springframework.cloud.gateway.event.RefreshRoutesEvent; import org.springframework.cloud.gateway.route.RouteDefinition; @@ -100,6 +101,7 @@ public class GatewayRouteRepository implements ApplicationEventPublisherAware, @Override public void deleteAll(String serviceId) { List idList = this.routes.values().stream() + .filter(zuulTargetRoute -> StringUtils.equalsIgnoreCase(serviceId, zuulTargetRoute.getServiceRouteInfo().getServiceId())) .map(zuulTargetRoute -> zuulTargetRoute.getRouteDefinition().getId()) .collect(Collectors.toList()); diff --git a/sop-example/sop-story/sop-story-web/src/main/resources/application-dev.properties b/sop-example/sop-story/sop-story-web/src/main/resources/application-dev.properties index c2709748..d0f57265 100644 --- a/sop-example/sop-story/sop-story-web/src/main/resources/application-dev.properties +++ b/sop-example/sop-story/sop-story-web/src/main/resources/application-dev.properties @@ -15,9 +15,9 @@ dubbo.registry.address=N/A dubbo.scan.base-packages=com.gitee.sop.storyweb.service # zipkin服务跟踪 -spring.zipkin.base-url=http://127.0.0.1:9411/ -# 设置sleuth收集信息的比率,默认0.1,最大是1,数字越大越耗性能 -spring.sleuth.sampler.probability=1 -# dubbo使用zipkin过滤器 -dubbo.provider.filter=tracing -dubbo.consumer.filter=tracing +#spring.zipkin.base-url=http://127.0.0.1:9411/ +## 设置sleuth收集信息的比率,默认0.1,最大是1,数字越大越耗性能 +#spring.sleuth.sampler.probability=1 +## dubbo使用zipkin过滤器 +#dubbo.provider.filter=tracing +#dubbo.consumer.filter=tracing