spring-cloud / spring-cloud/spring-cloud-commons
Add API to register services generically
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 751
- Forks
- 744
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 9
Description
Is your feature request related to a problem? Please describe.
I maintain a library that provides services via grpc. (https://github.com/yidongnan/grpc-spring-boot-starter)
I would like to provide my users with support for their spring-cloud service discovery implementation without me having to implement all of them myself.
Describe the solution you'd like
An API that allows me to register a service generically.
serviceRegistry.newRegistrationBuilder()
.id("my-service-grpc") // Setters for all common attributes
.host("10.0.13.37")
.port(15)
.name("x")
.secure("y")
[...]
.properties(someProperties) // Can be used to set implementation specific values (if there are any)
.metadata(someMetadata)
.register(); // Fires the events and registers the service
To improve compatibility the method could also return an Optional<RegistrationBuilder> and return Optional.empty() by default.
If you approve the concept of this API, then I'm willing (to try) to implement it for commons, eureka, consul, and nacos.
Describe alternatives you've considered
- Either manually implement them myself
- or attach additional metadata to the spring-web registrations and repurpose them <-- current workaround
(with a slight reduction of compatibility)
Additional context
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 by locating the serviceRegistry abstraction and the existing registration implementations for commons, Eureka, Consul, and Nacos. The issue names no files or tests; done would require an agreed generic registration-builder API that supports common attributes, properties, metadata, and registration behavior across the targeted implementations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, cloud, distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100