Skip to content

generate the RPC code automatically, mapping the .proto files to POJOs #122

Open
@joshlong

Description

@joshlong

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions