How to do it...

  1. Create a new Gradle/Java project with the following build.gradle file. Of note here is that we're installing and configuring the protobuf Gradle plugin, which will allow us to generate code from protobuf files using Gradle, and we're listing the required protobuf libraries as dependencies. Finally, we have to tell our IDE where to look for generated classes:
group 'com.packtpub.microservices'version '1.0-SNAPSHOT'buildscript {    repositories {        mavenCentral()    }    dependencies {        classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.3'    }}apply plugin: 'java'apply plugin: 'com.google.protobuf'apply plugin: 'application'mainClassName = 'com.packtpub.microservices.ch04.grpc.MessageServer'sourceCompatibility = 1.8repositories { ...

Get Microservices Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.