spring-projects / spring-projects/spring-grpc

Generate the RPC code automatically, mapping the `.proto` files to POJOs

Open
#122 6 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
413
Forks
95
Avg merge
4d 6h
Merged PRs (30d)
2

Description

I just had a twisted idea. could we, via cglib or via spring aot, handle the network code automatically given some POJOs ?

its a network protocol. we have the .proto definitions.

what's to stop us detecting types annotated by the user in their codebase and then, when methods are invoked, sending the right protobuff message across the wire using generation code that was synthesized at startup time or reified during AOT. Either way: no extraneous maven plugin, no need to subclass magic classes, etc.

naysayers will say that the generated code is faster than reflection. Which may well be true. but cglib generated code is as good as a compiled hand-written, compiled class on the class loader these days. and when people do graalvm images, we can do exactly what we do with cglib proxies elsewhere and simply write their definition out to disk and feed it into the graalvm compiler.

what I'd love to see is a Spring gRPC @Controller implementation, like what we have with Spring MVC, Spring GraphQL, Spring RSocket, Spring WebSocket, etc

thanks for listening to my Christmas list

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 comparing the requested Spring gRPC @Controller with the Spring MVC, Spring GraphQL, Spring RSocket, and Spring WebSocket approaches named in the issue, and review how the existing .proto definitions map to POJOs. The issue needs an agreed design and acceptance criteria before implementation can be considered done.

Written by the indexing model from the issue text.

Assessment

Tech stack
grpc, java, spring
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.