0

I developed a sdk that integrates the consul and actuator dependencies of the microservices, but there is a problem. If the actuator dependency exists, it always reports an error, the consul injection configuration fails. and the actuator is removed it will be ok.

some code :

https://github.com/lixinglin213/spring-cloud-sdk

lixinglin
  • 61
  • 1
  • 4
  • please provide the error and the spring cloud and spring boot versions – spencergibb Oct 09 '19 at 03:27
  • @spencergibb Thanks for your response, spring-boot version is 2.1.8.RELEASE,spring-cloud version is Greenwich.SR3. the error is : com.ecwid.consul.transport.TransportException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:8500 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused) – lixinglin Oct 09 '19 at 05:43
  • The reason is that my configuration does not take effect, the application.yml: ```yaml msp: registry: host: 172.16.34.156 port: 9090 tags: - demo=buhao prefer-ip-address: true instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${server.port} monitor: actuator: include: "*" show-details: always ``` – lixinglin Oct 09 '19 at 05:46
  • Those values need to go in bootstrap.yml – spencergibb Oct 09 '19 at 12:25
  • There is another way to override the ConsulClient bean. This initialization sequence guarantees the latest configuration. code: https://github.com/lixinglin213/spring-cloud-sdk/blob/master/src/main/java/com/thunisoft/msp/sdk/config/registry/RegistryConfigure.java – lixinglin Oct 11 '19 at 02:25

0 Answers0