Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Afeiamic
SpringCloud
提交
538e9dcd
SpringCloud
项目概览
Afeiamic
/
SpringCloud
通知
3
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
分析
仓库
DevOps
项目成员
Pages
SpringCloud
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
538e9dcd
编写于
1月 27, 2023
作者:
W
wangfeihu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
SpringCloud Config搭建配置中心客户端
解决配置中心没有注册到注册中心的bug
上级
daa800b5
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
101 addition
and
0 deletion
+101
-0
cloud-config-center-3344/pom.xml
cloud-config-center-3344/pom.xml
+4
-0
cloud-config-client-3355/pom.xml
cloud-config-client-3355/pom.xml
+47
-0
cloud-config-client-3355/src/main/java/com/afeiamic/springcloud/ConfigClientMain3355.java
...n/java/com/afeiamic/springcloud/ConfigClientMain3355.java
+14
-0
cloud-config-client-3355/src/main/java/com/afeiamic/springcloud/controller/ConfigClientController.java
...eiamic/springcloud/controller/ConfigClientController.java
+17
-0
cloud-config-client-3355/src/main/resources/bootstrap.yml
cloud-config-client-3355/src/main/resources/bootstrap.yml
+18
-0
pom.xml
pom.xml
+1
-0
未找到文件。
cloud-config-center-3344/pom.xml
浏览文件 @
538e9dcd
...
...
@@ -16,6 +16,10 @@
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-config-server
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-netflix-eureka-client
</artifactId>
</dependency>
<!-- web -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
cloud-config-client-3355/pom.xml
0 → 100644
浏览文件 @
538e9dcd
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
SpringCloud
</artifactId>
<groupId>
org.afeiamic.com.afeiamic.springcloud
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
cloud-config-client-3355
</artifactId>
<dependencies>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-config
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-netflix-eureka-client
</artifactId>
</dependency>
<dependency>
<groupId>
org.afeiamic.springcloud
</groupId>
<artifactId>
cloud-api-commons
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
cloud-config-client-3355/src/main/java/com/afeiamic/springcloud/ConfigClientMain3355.java
0 → 100644
浏览文件 @
538e9dcd
package
com.afeiamic.springcloud
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.netflix.eureka.EnableEurekaClient
;
@SpringBootApplication
@EnableEurekaClient
public
class
ConfigClientMain3355
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
ConfigClientMain3355
.
class
,
args
);
}
}
cloud-config-client-3355/src/main/java/com/afeiamic/springcloud/controller/ConfigClientController.java
0 → 100644
浏览文件 @
538e9dcd
package
com.afeiamic.springcloud.controller
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
public
class
ConfigClientController
{
@Value
(
"${config.info}"
)
private
String
configInfo
;
@GetMapping
(
"/configInfo"
)
public
String
getConfigInfo
()
{
return
configInfo
;
}
}
cloud-config-client-3355/src/main/resources/bootstrap.yml
0 → 100644
浏览文件 @
538e9dcd
server
:
port
:
3355
spring
:
application
:
name
:
config-client
cloud
:
config
:
# Config 客户端配置
label
:
master
# 分支名称
name
:
config
# 配置文件名称
profile
:
dev
# 读取后缀名称 上述 3 个综合: master 分支上 config-dev.yml 的配置文件被读取 http://config-3344.com:3344/master/config-dev.yml
uri
:
http://localhost:3344
# 配置中心地址
# 服务注册到 eureka 地址
eureka
:
client
:
service-url
:
defaultZone
:
http://eureka7001.com:7001/eureka,http://eureka7002.com:7002/eureka
# 集群版
pom.xml
浏览文件 @
538e9dcd
...
...
@@ -28,6 +28,7 @@
<module>
cloud-provider-sms-payment8999
</module>
<module>
cloud-gateway-gateway9527
</module>
<module>
cloud-config-center-3344
</module>
<module>
cloud-config-client-3355
</module>
</modules>
<!-- 统一管理jar包版本 -->
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录