spring-cloud / spring-cloud/spring-cloud-commons
Simple Discovery properties does not respect user configuration
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 751
- Forks
- 744
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 9
Description
Describe the bug
I expect environment variables to be usable to configure simple discovery.
The loop initializing the serviceId in the configured simple service properties breaks user config if done [1].
Is it possible to change this loop logic ([1]) to set the service id if not set and if set ensure the key is the serviceId configured and not the deduced one with spring env->properties mapping logic which is easily wrong if the services use iphen in the name.
Sample
Not sure it is needed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/simple/SimpleDiscoveryProperties.java around line 81, where the serviceId initialization loop is described. Trace how configured simple service properties are populated from environment variables, especially names containing hyphens. Done means configured service IDs are preserved and only unset IDs are deduced correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100