• Stars
    star
    242
  • Rank 167,048 (Top 4 %)
  • Language
    Scala
  • License
    MIT License
  • Created over 9 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Project showcasing different microservice communication styles using Scala, Akka, Play and other tools from Scala ecosystem

Reactive microservices

Join the chat at https://gitter.im/theiterators/reactive-microservices

Reactive microservices is an Typesafe Activator Template completely devoted to microservices architecture. It lets you learn about microservices in general - different patterns, communication protocols and 'tastes' of microservices. All these concepts are demonstrated using Scala, Akka, Play and other tools from Scala ecosystem. For the sake of clarity, we skipped topics related to deployment and operations.

Prerequisites

To feel comfortable while playing with this template, make sure you know basics of Akka HTTP which is a cornerstone of this project. We recently released an Akka HTTP activator template that may help you start. At least brief knowledge of Akka remoting, Akka persistence, Akka streams and Play Framework websockets is also highly recommended.

Structure

This activator template consists of 9 runnable subprojects β€”Β the microservices:

  • auth ones:
    • auth-codecard
    • auth-fb
    • auth-password
    • identity-manager
    • session-manager
    • token-manager
  • business logic ones:
    • btc-users
    • btc-ws
  • miscellaneous ones:
    • metrics-collector

They uses different communication methods, different databases, and different frameworks.

Setup

Review the configuration files

Take some time to review application.conf files that are located in resource subdirectory of each microservice. You can also look at docker-compose.yml file, which contains docker preconfigurated images for all the required databases.

Run migrations (You don't need to do this step if you want to use our docker container)

For auth-codecard, identity-manager and auth-password you need to run the SQL migration scripts which are located in postgres directory. If you want to use non-default names please tweak the application.conf files. You can also tweak and use this script in your console.

cd /where/this/activator/template/is/located/
psql -h localhost -U postgres -f ./postgres/init.sql &&
psql -h localhost -U postgres -f ./postgres/auth_entry.sql &&
psql -h localhost -U postgres -f ./postgres/identity.sql

Running

Run docker-compose up in project main directory to launch databases, or if you are using your own database instances, make sure you have PostgreSQL, MongoDB and Redis up and running.

akka-http

You can run each service separately, but we also we provided a SBT task called runAll.

Play

Due to some issues with Play/sbt cooperation metrics-collector and btc-ws should be run separately. In order to run them in one sbt CLI instance use these commands:

; project btc-ws; run 9000
; project metrics-collector; run 5001

Everything else should work out of the box. Enjoy!

Author & license

If you have any questions regarding this project contact:

Łukasz Sowa [email protected] from Iterators.

For licensing info see LICENSE file in project's root directory.

More Repositories

1

akka-http-microservice

Example of http (micro)service in Scala & akka-http
Scala
750
star
2

kebs

Scala library to eliminate boilerplate
Scala
155
star
3

http4s-stir

http4s-stir offers Pekko HTTP-style (Akka HTTP-style) DSL directives for http4s using cats-effect's IO as an effect system
Scala
33
star
4

sealed-monad

Scala library for nice business logic oriented, for-comprehension-style error handling
Scala
23
star
5

free-monad-on-app-level-code

Scala
19
star
6

java-jwt-wrapper

Scala
10
star
7

flyway-docker

Dockerized flyway command line tool
Dockerfile
8
star
8

baklava

Generate openapi, HTML docs or TypeScript client interface from routing tests
Scala
7
star
9

lambda-days-free-workshop

Scala
7
star
10

kebs-intellij

A companion IntelliJ IDEA plugin for kebs library
Scala
6
star
11

error-benchmarks

Code for the "Benchamrking Functional Error Handlling in Scala" blog post (https://www.iteratorshq.com/blog/benchmarking-functional-error-handling-in-scala)
Scala
5
star
12

cors-buster

Simple, lightweight proxy that bypasses CORS intended for development
Scala
5
star
13

scalar-2017-optics-workshop

Scala
4
star
14

warsjawa-ms-spray

Scala
3
star
15

aglio-docker

Dockerfile for aglio
2
star
16

docker-git-s3cmd

Dockerfile
2
star
17

warsjawa-ms-play-template

Scala
2
star
18

scalawave-2017-optics-workshop

2
star
19

node-git-s3cmd

Docker image with node and s3cmd
Dockerfile
2
star
20

docker-git-sbt

Dockerfile
2
star
21

warsjawa-ms-play

Scala
2
star
22

warsjawa-ms-spray-template

Scala
2
star
23

drakov-docker

Dockerfile for drakov
2
star
24

logstash-jdbc-postgres

Logstash with PostgreSQL support via jdbc
Dockerfile
2
star