spring-cloud / spring-cloud/spring-cloud-commons

Provide Spring gRPC DiscoveryClient integration

Open
#1,675 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

waiting-for-triage
Dominant language
Java
Stars
751
Forks
744
Avg merge
1d 14h
Merged PRs (30d)
9

Description

Description

spring-projects/spring-grpc issue #341 requested support for resolving gRPC client targets such as discovery:///service-name through Spring Cloud DiscoveryClient.

A working prototype was implemented in spring-grpc, but Spring gRPC maintainers noted that this integration should live on the Spring Cloud side because of the dependency direction between Spring Boot, Spring gRPC and Spring Cloud:

Proposed Scope

Add a Spring Cloud module that bridges Spring Cloud service discovery with Spring gRPC by:

  • resolving discovery:///service-name targets through DiscoveryClient
  • refreshing resolved addresses when Spring Cloud publishes a HeartbeatEvent
  • preferring the gRPC_port metadata entry and falling back to the regular service instance port
  • optionally publishing spring.grpc.server.port as gRPC_port metadata through the Registration abstraction when metadata is mutable

Why This Belongs Here

The implementation depends on Spring Cloud abstractions such as:

  • DiscoveryClient
  • HeartbeatEvent
  • Registration

while the gRPC side can stay limited to Spring gRPC extension points.

Prior Art / Prototype

The current prototype and discussion live here:

Question

Would Spring Cloud Commons accept this as:

  1. a new module in this repository, or
  2. a different Spring Cloud repository / subproject?

If this repository is acceptable, I can adapt the current prototype to match Spring Cloud Commons conventions and open a PR here.

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 the prototype and discussion in spring-grpc issue #341 and PR #394, then review the DiscoveryClient, HeartbeatEvent, and Registration abstractions named here. Confirm the module location and Spring Cloud Commons conventions before adapting the integration; done means discovery:/// targets resolve, heartbeat changes refresh addresses, and gRPC_port metadata behavior is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
backend-api-design, cloud, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.