From the course: Building Java Microservices with gRPC

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Define user.proto and generate service stubs

Define user.proto and generate service stubs

From the course: Building Java Microservices with gRPC

Start my 1-month free trial

Define user.proto and generate service stubs

- [Instructor] The next step will be to build the service definition file which is the user.proto. So let's go back to the IDE and first I'll create a folder here under the main, label that as proto and make sure you mark this directory as a source folder. And under this, I'll create a file, which is user.proto. So let's go ahead and define the user service. The first statement will of course be the syntax. So that will be proto3. The next will be the packet statement. So let's give this a proper name, we'll call it com.shopping.stubs.user. We'll additionally also define the java_package to explicitly state the Java package. And I'm going to keep that exactly same as the one that we defined on line number three. So let's copy this and let's provide that as a value. Also, let's make sure that java_multiple_files is set to true. The next step is to define the service. So we'll say service, give a name, user service.…

Contents