我有一个死掉的简单配置服务器,它具有以下属性:
spring:
profiles:
active: native
cloud:
config:
server:
native:
searchLocations: classpath:/configs
server:
port: 8888在src/main/resources文件夹中,我有一个信任文件夹,其中包含一个customer-service.yml文件,其中包含以下配置:
spring:
application:
name: customer-service
h2:
console:
enabled: true
server:
port: 8080
eureka:
client:
serviceUrl:
defaultZone: ${EUREKA_URI:http://localhost:8761/eureka}
instance:
preferIpAddress: true
leaseRenewalIntervalInSeconds: 1
leaseExpirationDurationInSeconds: 2
logging:
level:
com.netflix: WARN配置服务器启动时没有问题,但在浏览器- http://localhost:8888/customer-service/master -中发出以下URL -返回以下响应:
{"name":"customer-service","profiles":["master"],"label":null,"version":null,"state":null,"propertySources":[]}使用类路径上的文件夹来存储信任信息的例子似乎并不多。我做错了什么?
发布于 2019-02-27 20:52:54
我刚刚在Spring2.1.3中试用了它,它的工作原理是您已经准备好了。由于您提到您使用的是Spring2.2,所以可能会发生更改,或者可能会出现错误。
更新
只是为了刺激,我尝试了2.2.0,tried快照,它也工作。现在不知道该说什么。
https://stackoverflow.com/questions/54912480
复制相似问题