Can I generate messages as a separate project and then reuse these message types for server and client?
See original GitHub issueI am thinking about the following project structure:
+-- Messages
|
+-- messages.proto (compiled)
+-- service.proto (not compiled, imports `messages.proto`)'
+-- Server (references `Messages` project, so generaetd message could be reused, generates server)
|
+-- service.proto (added as a link from `Messages` project)
+-- Client (references `Messages` project, so generaetd message could be reused)
|
+-- service.proto (added as a link from `Messages` project, generates client.)
Is it possible to achieve? And if yes, how?
Issue Analytics
- State:
- Created 10 months ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Reusing and Recycling Data Structures in gRPC Services ...
Here's everything you need to know to create a standard set of reusable message formats to use with your gRPC services.
Read more >Shared gRPC protobuf files in multiple projects
These reusable messages I would like to put in that shared project I mentioned before and only set links to these files. I...
Read more >Proto Best Practices
Proto Best Practices · Don't Re-use a Tag Number · Don't Change the Type of a Field · Don't Add a Required Field...
Read more >A-Z guide to reusability: APIs and integrations
Reusability is when an integration object or process is built and then used several times after its initial use — either by the...
Read more >Performance best practices with gRPC
A gRPC channel should be reused when making gRPC calls. Reusing a channel allows calls to be multiplexed through an existing HTTP/2 connection....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think the Liber example is what you want to do:
The projects here use the
GrpcServies
metadata that I mentioned before to control what code is compiled into each project to avoid compiling anything twice so you shouldn’t have two types with the same name in different assemblies (and no aliases will be needed).Messages can be generated on there own. But a client or server is always generated with messages.