spring-cloud / spring-cloud-consul

Spring Cloud Consul
http://cloud.spring.io/spring-cloud-consul/
Apache License 2.0
813 stars 541 forks source link

Spring Config Client + Consul Discovery First Bootstrap - service IP Address not getting resolved as registered in Consul #716

Closed narramadan closed 3 years ago

narramadan commented 3 years ago

Hi All,

This issue is more inline with https://github.com/spring-cloud/spring-cloud-consul/issues/714. Accessing /actuator/refresh was causing error in Config Client with Discovery First Approach.

https://github.com/spring-cloud/spring-cloud-consul/issues/714 is fixed with spring-cloud-dependencies v2020.0.2. I bumped the version in my project to v2020.0.2 and I can see /actuator/refresh is working as expected.

But this broke resolving IP address of the service that is registered in consul, which was working with spring-cloud-dependencies v2020.0.1.

With no changes to the code, toggling spring-cloud-dependencies in pom.xml to

Sample As this involves multiple components to reproduce, please clone the below repo and execute the steps in sequence

Code is available in git repo - https://github.com/2much2learn/article_2021_jan_spring-cloud-config-configfirst_discoveryfirst

Run the below series of commands to replicate the issue

-- Run Consul Container
$ docker run -d --name consul-server -p 8500:8500 -e CONSUL_BIND_INTERFACE=eth0 consul

-- Clone and build the packages
$ git clone https://github.com/2much2learn/article_2021_jan_spring-cloud-config-configfirst_discoveryfirst.git
$ cd article_2021_jan_spring-cloud-config-configfirst_discoveryfirst
$ cd spring-multi-module-cloud-config-consul-discovery
$ mvn clean package

-- Start config-server
$ java -jar -Dspring.profiles.active=native config-server\target\config-server-0.0.1-SNAPSHOT.jar

-- Start spring boot services
$ java -jar service-b\target\service-b-0.0.1-SNAPSHOT.jar

$ java -jar service-a\target\service-a-0.0.1-SNAPSHOT.jar

Can you please let me know if this is a valid issue or should something be changed at my end with v2020.0.2 ?

Thanks, Madan N

cc: @spencergibb @pcoates33 @royremi

spencergibb commented 3 years ago

please provide the stack trace

spring-cloud-issues commented 3 years ago

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-cloud-issues commented 3 years ago

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.