mfarache / micronaut-ms

21 stars 7 forks source link

Description

This project contains the evolution of my blog series about Micronaut

I recommend to read the first post to grab an idea of what we are buillding.

NOTE: If you start reading the series you will find out that the project structure has changed.

In case you are interested on seeing the evolution or want to play with something specific.

The following tags match with each of the blog posts:

Tables Tag
Micronaut series - part I (Consul, Service Discovery & Registry) blog-1
Micronaut series - part II ( Traceability & Server side events) blog-2
Micronaut series - part III (Deployment using K8) blog-3
Micronaut series - part IV (Serverless functions) blog-4

Clone this project

Assume $workspace is the root to all projects

Contents

There are 2 microservices and one serverless function.

Both microservices implement the following features :

There are supporting files that are necessary for + Micronaut series - part III (Deployment using K8)

The final architecture after 4 iterations looks like:

Proejct Dependencies

A bit of history. Why so many projects?

Initially only 2 microservices were available. They were
strongly coupled in the sense that Waiter depended fully on the Billing (including both server and client bits).

That was a flaw in the design that has side impact like exposing the billing endpoint through the waiter application, which is undesired. Therefore every microservice has now a server, client and model. Same happens for the serverless function explained in Micronaut series - part IV

Start consul (optional if u only want to build)

There are integration tests that require having a consul server. You can skip this step if you prefer to build all the project skipping test execution with maven

docker run -p 8500:8500 consul

Start zipkin (optional if u only want to build)

You can skip this step if you prefer to build all the project skipping test execution with maven

docker run -d -p 9411:9411 openzipkin/zipkin

Build

1. billing model and beer model

cd $workspace/beer-billing-model/ ; mvn clean install
cd $workspace/beer-cost-function-model/ ; mvn clean install

2. Build client and server app for Lambda functions

cd $workspace/beer-cost-function/ ; mvn clean install
cd $workspace/beer-cost-function-client/ ; mvn clean install
cd $workspace/beer-cost-function-app/ ; mvn clean install

3. Build the billing project


cd $workspace/beer-billing/ ; mvn clean install
cd $workspace/beer-billing-client/ ; mvn clean install

4. Build the waiter project

cd $workspace/beer-waiter/ ; mvn clean install