Sunday, October 07, 2018

Giter8 templates for FreestyleRPC - Part 1

The freestyle RPC  project http://frees.io/docs/rpc has an example project demonstrating a GRPC based micro service that uses a Doobie based persistence layer.

I have created a set of templates that can give developers a head start in setting up Sbt builds for a real world set of services based on this set of examples.



https://github.com/jmjava
The templates are located at:

https://github.com/jmjava

To use the templates you must first install java8 and sbt.

I found this gist that shows how to do this on Ubuntu 16.04


Once you have SBT installed you can use the templates to create your working set of projects.

Follow these steps:

mkdir prototype

cd prototype

sbt new /jmjava/freestyle-lib-template.g8

cd freestylelib

sbt publishLocal

cd ../

sbt new jmjava/freestyle-rpc-protocol-template.g8  (accept defaults for prompts)

cd freestyleprotocol

sbt publishLocal

cd ../

sbt new jmjava/freestyle-rpc-runtime-template.g8

cd freestyleruntime

sbt publishLocal

cd ../

sbt new jmjava/freestyle-rpc-server-template.g8

cd freestyleserver

sbt compile

sbt run

-- open a new terminal

sbt new jmjava/freestyle-rpc-client-template.g8

cd freestyleclient

sbt compile

sbt run

You should see messages going between client and debug messages in the server log from the Hikari pool.  







In part 2 we will explore deploying the server to a Kubernetes / Istio setup.








No comments: