spring-cloud / spring-cloud-consul

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

Spring Cloud Consul Config fails to detect retry properties in profile #718

Open sergey-morenets opened 3 years ago

sergey-morenets commented 3 years ago

Hi

I have Spring Cloud application with Spring Retry and Spring Cloud Consul Config libraries. Here's my application.yml:

spring:
  profiles:
    active:
    - prod

application-prod.yml:

spring:
  cloud:
    consul:
      retry:
        enabled: true
        initialInterval: 2000
        multiplier: 2
        maxInterval: 60000
  config:
    import: consul:consul:8500/demo/default;demo/prod

Unfortunately the retry properties in application-prod.yml are not detected and default RetryProperties values are used. If I move retry properties into application.yml then property values are detected and used properly. What is interesting is that spring.config.import value is detected correctly (from application-prod.yml).

Spring Cloud Consul 3.0.2

spencergibb commented 3 years ago

See https://github.com/spring-cloud/spring-cloud-config/issues/1797

hannah23280 commented 3 years ago

Hi sergey-morenets,

   I am struggling currently to make my microservice able to automatically retry re-register after I stop and restart my consul agent. But keeps failing to achieve that.  I assume yours is able to achieve that. May I know which dependencies do u choose in the https://start.spring.io/  .  I could not even find and choose the spring retry library from this website.

Appreciated and Thanks if u can help me out.

sergey-morenets commented 3 years ago

Hi sergey-morenets,

   I am struggling currently to make my microservice able to automatically retry re-register after I stop and restart my consul agent. But keeps failing to achieve that.  I assume yours is able to achieve that. May I know which dependencies do u choose in the https://start.spring.io/  .  I could not even find and choose the spring retry library from this website.

Appreciated and Thanks if u can help me out.

Hi @hanct

This ticket is about Spring Cloud Consul Config and your use-case is about Consul usage as service discovery. So I guess if you have some issues you should create another ticket.

hannah23280 commented 3 years ago

Hi sergey-morenets,

   I am struggling currently to make my microservice able to automatically retry re-register after I stop and restart my consul agent. But keeps failing to achieve that.  I assume yours is able to achieve that. May I know which dependencies do u choose in the https://start.spring.io/  .  I could not even find and choose the spring retry library from this website.

Appreciated and Thanks if u can help me out.

Hi @hanct

This ticket is about Spring Cloud Consul Config and your use-case is about Consul usage as service discovery. So I guess if you have some issues you should create another ticket.

okie. Sorrie. I misunderstood your post. Thanks for clarification