Spring cloud Spring云配置+;尤里卡+;Zuul-在客户端中看不到属性
我正在使用SpringCloud开发一个基于微服务架构的应用程序 我目前在项目中有四个应用程序:Spring cloud Spring云配置+;尤里卡+;Zuul-在客户端中看不到属性,spring-cloud,netflix-eureka,netflix-zuul,spring-cloud-netflix,spring-cloud-config,Spring Cloud,Netflix Eureka,Netflix Zuul,Spring Cloud Netflix,Spring Cloud Config,我正在使用SpringCloud开发一个基于微服务架构的应用程序 我目前在项目中有四个应用程序: 配置服务器,eureka服务器,网关服务(zuul)和eureka客户端,我正使用它们来测试项目是否按预期工作 但是我在从配置服务器获取属性时遇到问题。 我有一个git存储库,其中有一个文件,eureka client.yml。 此文件有一个属性消息:test message 如果转到,我可以看到该属性已加载到配置服务器中 但当我访问eureka客户端中的属性时,它返回null 获取属性(“消息”)
配置服务器
,eureka服务器
,网关服务(zuul)
和eureka客户端
,我正使用它们来测试项目是否按预期工作
但是我在从配置服务器获取属性时遇到问题。
我有一个git存储库,其中有一个文件,eureka client.yml
。
此文件有一个属性消息:test message
如果转到,我可以看到该属性已加载到配置服务器中
但当我访问eureka客户端中的属性时,它返回null
获取属性(“消息”)
有人能告诉我我做错了什么吗?我可能只是缺少一个配置或.yml属性,但找不到是哪一个
客户机还应该通过Eureka从配置服务器获取属性
编辑:
eureka服务器-application.yml
server:
port: 8761
eureka:
instance:
hostname: localhost
client:
register-with-eureka: false
fetch-registry: false
service-url:
default-zone: http://${eureka.instance.hostname}:${server.port}/eureka/
server:
port: 8082
server:
port: 8888
spring:
cloud:
config:
server:
git:
uri: https://github.com/bpuscasu/config-server
eureka客户端-application.yml
server:
port: 8761
eureka:
instance:
hostname: localhost
client:
register-with-eureka: false
fetch-registry: false
service-url:
default-zone: http://${eureka.instance.hostname}:${server.port}/eureka/
server:
port: 8082
server:
port: 8888
spring:
cloud:
config:
server:
git:
uri: https://github.com/bpuscasu/config-server
并使用@EnableDiscoveryClient进行注释
配置服务器-application.yml
server:
port: 8761
eureka:
instance:
hostname: localhost
client:
register-with-eureka: false
fetch-registry: false
service-url:
default-zone: http://${eureka.instance.hostname}:${server.port}/eureka/
server:
port: 8082
server:
port: 8888
spring:
cloud:
config:
server:
git:
uri: https://github.com/bpuscasu/config-server
并用@EnableConfigServer和@EnableDiscoveryClient注释它可以是任何东西。你能用eureka客户端和配置服务器的配置以及任何相关日志更新你的问题吗?我更新了我的原始问题。谢谢。我需要客户端应用程序tooClient应用程序具有以下依赖项:SpringCloudStarterConfig,SpringCloudStarterEureka。使用EnableDiscoveryClient进行注释,并有一个RestController,我在其中自动连接了一个环境。没什么了。到目前为止,这些都与尤里卡无关。eureka客户端是否有spring cloud starter配置依赖项?它可以是任何东西。你能用eureka客户端和配置服务器的配置以及任何相关日志更新你的问题吗?我更新了我的原始问题。谢谢。我需要客户端应用程序tooClient应用程序具有以下依赖项:SpringCloudStarterConfig,SpringCloudStarterEureka。使用EnableDiscoveryClient进行注释,并有一个RestController,我在其中自动连接了一个环境。没什么了。到目前为止,这些都与尤里卡无关。eureka客户端是否具有spring cloud starter配置依赖关系?