spring-cloud / spring-cloud/spring-cloud-consul

Spring Cloud Consul Config fails to detect retry properties in profile

Open
#718 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
822
Forks
539
Avg merge
9h 31m
Merged PRs (30d)
7

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with application.yml and application-prod.yml, then trace how RetryProperties receives the spring.cloud.consul.retry.* values when the profile-specific configuration is loaded. Reproduce the issue with the shown Spring Cloud Consul 3.0.2 configuration; done means the profile values are used instead of the default retry settings.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.