*****配置服务器-应用程序服务设置*****
下面是来自 application.yml 的配置
server: port: 8882 eureka: client: serviceUrl: defaultZone: http://localhost:8761/eureka/ spring: cloud: config: server: git:uri: https://github.com/appleman/config
下面是来自 boostrap.yml 的配置
spring: application: name: configserver
这个简单的 spring boot 应用程序的启动将 config-server 注册到 Eureka。
**通用 Eureka Server 运行在 8761 端口
********下面是应用程序客户端配置*****
下面是我的 bootstrap.yml 中的应用程序客户端配置
spring: application: name: contractService,envDEV13 cloud: config: enabled: true discovery: enabled: true serviceId: configserver eureka: instance: nonSecurePort: ${server.port:8080} client: serviceUrl: defaultZone: http://${eureka.host:localhost}:${eureka.port:8761}/eureka/
在 Spring Controller 中注入如下代码片段的属性不起作用。
@Value("${creditService.eppDbUrl}") String bar;
如果我们做错了什么,请建议我们。