From 8c8b1c7442eb55030d2a3dbb1fbfe8b61378eaf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=BF=97=E5=BC=BA?= Date: Sat, 31 Oct 2020 13:37:25 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=8D=87=E7=BA=A7SpringBoot,alibaba,?= =?UTF-8?q?springCloud=E7=89=88=E6=9C=AC=E3=80=82=202=E3=80=81=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E9=83=A8=E5=88=86=E5=9C=A8SpringBoot=E5=B7=B2?= =?UTF-8?q?=E7=BB=8F=E5=AE=9A=E4=B9=89=E7=9A=84=E4=BE=9D=E8=B5=96=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E7=89=88=E6=9C=AC=E5=86=B2=E7=AA=81=E3=80=82?= =?UTF-8?q?=203=E3=80=81=E5=8D=87=E7=BA=A7guava=E7=89=88=E6=9C=AC=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 18 +++++++++--------- .../configuration/ServiceConfiguration.java | 5 +++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index e761db9a..95c92603 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot spring-boot-starter-parent - 2.2.5.RELEASE + 2.3.4.RELEASE @@ -36,17 +36,17 @@ 1.8 - 2.2.5.RELEASE + 2.3.4.RELEASE - Hoxton.SR3 + Hoxton.SR8 - 2.2.1.RELEASE + 2.2.3.RELEASE 1.2.3 - 1.7.5 + 4.11 @@ -58,11 +58,11 @@ 3.8.1 1.11 1.2 - 2.0.1.Final - 6.0.13.Final + + 1.9.1 2.3.0.RELEASE - 27.1-jre + 29.0-jre 1.5.21 2.9.2 2.9.2 @@ -254,4 +254,4 @@ - \ No newline at end of file + diff --git a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/configuration/ServiceConfiguration.java b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/configuration/ServiceConfiguration.java index 1f302e88..07294768 100644 --- a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/configuration/ServiceConfiguration.java +++ b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/configuration/ServiceConfiguration.java @@ -1,6 +1,7 @@ package com.gitee.sop.servercommon.configuration; import com.alibaba.cloud.nacos.NacosDiscoveryProperties; +import com.alibaba.cloud.nacos.NacosServiceManager; import com.alibaba.cloud.nacos.discovery.NacosWatch; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.ObjectProvider; @@ -21,7 +22,7 @@ public class ServiceConfiguration extends SpringmvcConfiguration { @Bean @ConditionalOnMissingBean @ConditionalOnProperty("spring.cloud.nacos.discovery.server-addr") - public NacosWatch nacosWatch(NacosDiscoveryProperties nacosDiscoveryProperties, ObjectProvider taskScheduler, Environment environment) { + public NacosWatch nacosWatch(NacosDiscoveryProperties nacosDiscoveryProperties, ObjectProvider taskScheduler, Environment environment, NacosServiceManager nacosServiceManager) { Map metadata = nacosDiscoveryProperties.getMetadata(); String contextPath = environment.getProperty(METADATA_SERVER_CONTEXT_PATH); // 将context-path信息加入到metadata中 @@ -31,7 +32,7 @@ public class ServiceConfiguration extends SpringmvcConfiguration { // 在元数据中新增启动时间,不能修改这个值,不然网关拉取接口会有问题 // 如果没有这个值,网关会忽略这个服务 metadata.put("server.startup-time", String.valueOf(System.currentTimeMillis())); - return new NacosWatch(nacosDiscoveryProperties, taskScheduler); + return new NacosWatch(nacosServiceManager, nacosDiscoveryProperties, taskScheduler); } }