Project Development Environment

60 views
Skip to first unread message

selcuk...@gmail.com

unread,
Jun 30, 2017, 8:20:55 AM6/30/17
to grpc.io
Hi,

I have two projects. One for server and the other one is for the client. I create the proto file inside the server project and let the code generator to generate server base class, client stub and request/response message classes. It goes all well for the server side.

After having the auto-generated files, I'm copying the stub and message classes to the client project.

Am I doing right? What are the best practices to create a smooth development environment for both server and client side?
For example, I've read that one of the software companies have created a different repo/project for proto files. They use some scripts to copy around the projects.

Thanks,

--
Selcuk

Carl Mastrangelo

unread,
Jun 30, 2017, 8:05:38 PM6/30/17
to grpc.io
Making a canonical repo for protos and sharing them with the other projects is the best way.  If possible, each sub project (like your client, or server) should generate their own stubs independent of the other.  Most build tools have a step for generating code.  

Selcuk Bozdag

unread,
Jul 1, 2017, 11:23:52 AM7/1/17
to grpc.io
Thanks Carl, we are going to create a so called "monorepo" and distribute proto files to each projects.
Thanks for great advice.

One more thing if you don't mind, the servers are serving
on the same machine but different ports. We've read that
a proxy needs to run as a front end. Is it the best practice? Do you have any point on that?

Thanks

Carl Mastrangelo

unread,
Jul 5, 2017, 3:42:07 PM7/5/17
to grpc.io
You may wish to run a proxy as a load balancer, or a TLS terminator, but I can't give more specific advise since it differs per project.  You don't *have* to run a proxy, but many people do.  

Selcuk Bozdag

unread,
Jul 6, 2017, 7:08:43 AM7/6/17
to grpc.io
How about adding services as starting the server?

.addService(
new ServiceAImpl())
.addService(new ServiceBImpl())

Is it okay to run a server like that?

Carl Mastrangelo

unread,
Jul 11, 2017, 3:45:08 PM7/11/17
to grpc.io
I don't think I understand your question, in the context of your first post.  You certainly can do that, but I don't think it will help with sharing your protos.
Reply all
Reply to author
Forward
0 new messages