microservices with the playframework

18
Microservices with the PlayFramework Dominik Dorn [email protected] www.playframework.wien

Upload: dominik-dorn

Post on 07-Feb-2017

35 views

Category:

Software


0 download

TRANSCRIPT

Microservices with the PlayFrameworkDominik [email protected]

www.playframework.wien

Dominik Dorn

Freelance Software Engineer & “Dev-Lead”

Java 8 & Scala enthusiast

PlayFramework lover

Akka delivery guy

@domdorn

Agenda

What’s a Microservice again?

Microservices with the PlayFramework

Manual, “Controller First” & “API First”

Bonus: Helpful utilities / projects

Bonus: Deployments with Docker, CI / CD

What’s a Microservice again?In essence, just a very “small” application.

Single Responsibility Principle: Does one thing well

Usually exports a “service” through some well defined way aka. “Interface”

Small enough, to be thrown away and replaced within a week or two

Microservices with the PlayFramework

We’ll export a Swagger Specification (Open API) for Clients

Manually create an App

Create a Swagger-Definition from Controllers

API First: Create code from the Spec

DemoThe manual way

DemoSwagger from Controllers

Demo API First: Code from Swagger

https://github.com/zalando/api-first-hand

BonusHelpful utilities / projects

Swagger Editor: http://editor.swagger.io/

guardian-management-play: https://github.com/guardian/guardian-management-play

guardian/frontend

Play-Parseq

Swagger-Editor

guardian-management-play

github.com/guardian/frontend

API-Gateway

+

Bonus: Docker-Deployments

DemoCreating a Docker-Container

DockerDon’t create a Play-PID File

Log only to STDOUT & Kibana (not to files)

Don’t write anything to files (except on mounted volumes)

reboot: true

Docker-Compose-Repo + CI-Server + SSH => CD

–Dan Zadra

“You gave me your time, the most thoughtful gift of all.”

Thank you!