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.
Generate stubs using protoc
From the course: Building Java Microservices with gRPC
Generate stubs using protoc
- [Instructor] We have downloaded the utilities, we have written the service definition, the last part of this demo will be to generate the stubs from the service definition. To do this, we are going to run the protoc command and this command takes in three arguments. The first is the plugin path. The plugin is basically used to generate your service class. So we need to feed the part of that plugin. This plugin was already downloaded as a utility before. Second, it requires the source folder where it'll pick up your proto file from. So we'll specify that. And the third argument is that destination folder or the output directory in which all the auto-generated classes are going to be placed. So what we will do is, we will define a local environment variable on the windows system for each of these arguments first. Once we do that, then we will run the protoc command. So I'll go back to my editor, I'll open a new file and…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.