gRPC Kotlin starter

Overview

This directory contains a simple bar service written as a Kotlin gRPC example.
You can find detailed instructions for building and running example from below

File organization

The starter sources are organized into the following top-level folders:

  • protos: .proto files for generating the stubs
  • stub: regular Java & Kotlin stub artifacts from protos
  • server: Kotlin servers based on regular stub artifacts
  • client: Kotlin clients based on regular stub artifacts

Set up and run the starter on macOS

  • Install Homebrew

    Download and install Homebrew:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  • Install JDK

    Install any version of JDK (8 preferred):

    brew install openjdk@8

    Add the installed version of JDK to your path through .zshrc or .bash_profile

    echo 'export PATH="/usr/local/opt/openjdk@8/bin:$PATH"' >> ~/.zshrc
    source ~/.zshrc

    or

    echo 'export PATH="/usr/local/opt/openjdk@8/bin:$PATH"' >> ~/.bash_profile
    source ~/.bash_profile
  • Clone the project and run the bar service and client starter

    Clone and navigate into the project:

    git clone https://github.com/hwslabs/grpc-kotlin-starter.git
    cd grpc-kotlin-starter

    Start the server:

    ./gradlew :server:BarServer

    In another console, run the client which will make requests to the server:

    ./gradlew :client:BarClient

GitHub

View Github