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

ConfigWatch requires spring-boot-actuator

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

Nobody has claimed this yet.

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

Description

Hi,

I'm using consul config in a spring application that doesn't have a web server. So I didn't include spring-boot-actuator, since I didn't see the need for it. However in ConsulConfigAutoConfiguration the ConfigWatch is enabled only when RefreshEndpoint from actuator is available.

If I put the following into my app, ConfigWatch works as expected without the actuator dependency.

@EnableScheduling
public class App extends SpringApplication {

    @Bean
    public ConfigWatch configWatch(ConsulConfigProperties properties, ConsulPropertySourceLocator locator, ConsulClient consul) {
        return new ConfigWatch(properties, locator.getContexts(), consul);
    }
}

Actuator enables scheduling automatically in MetricExportAutoConfiguration and so it would have to be enabled in ConsulConfigAutoConfiguration. I don't think there would be any side-effects from this change.

Cheers,
Michal

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 by reading ConsulConfigAutoConfiguration and ConfigWatch, focusing on the RefreshEndpoint condition and the scheduling setup. Reproduce the reported case in a Spring application without a web server or spring-boot-actuator, comparing it with the shown ConfigWatch bean. Done means ConfigWatch works without the actuator dependency while the existing configuration behavior remains intact.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.