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

Config delete does not trigger the context refresh event

Open
#740 0 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

Hello everyone, I would like to know the reason behind this if-check in the ConfigWatch
https://github.com/spring-cloud/spring-cloud-consul/blob/main/spring-cloud-consul-config/src/main/java/org/springframework/cloud/consul/config/ConfigWatch.java#L162

In my view, the situation when some property or whole config file is deleted is perfectly valid, and must trigger a context refresh event to switch off some beans or switch to default property values. But now this is not possible, because such events are ignored because of aforementioned if-check. I think it is possible to remove it without breaking things to support cases when properties are deleted. Please let me know if I am wrong.

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 ConfigWatch.java at the if-check around line 162 and trace how Consul configuration changes become context refresh events. Reproduce deletion of a property or whole configuration file, then verify whether the expected refresh event is emitted and deleted values fall back or disable affected beans.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.