supervise your akka actors - devoxx

31
@njozwiak #Devoxx #SuperviseAkka Supervise your Akka actors Nicolas Jozwiak Xebia

Upload: xebia-france

Post on 05-Jul-2015

424 views

Category:

Software


0 download

DESCRIPTION

People around you are talking about Akka and you ask yourself which kind of architecture you could set up, or how you can integrate them in your architecture ? And what is the learning curve ? Through a feedback, we’ll answer these questions and will show how, in 3 months, we set up an architecture based on Akka and Spray in Scala. We’ll speak about performance issues and fault tolerance with supervisors. Also we’ll see why it’s important to have some monitoring and efficient tests. Par Nicolas Jozwiak

TRANSCRIPT

Page 1: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

Supervise your Akka actorsNicolas Jozwiak

Xebia

Page 2: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

Who am I

Programmer and agiliste

@njozwiak

Page 3: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

Agenda

• Context

• Why Akka and Scala ?

• Solution

• DevOps

• Issues and key learnings

• Results

Page 4: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

Context

Page 5: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

Talend

offers

Web Service offers

Logstash ElasticSearch UI result

syslog

offersFTP

1 Read FTP

2

Translate Xml in Jobs

3 Ask Web Service for diff

4 Save

Page 6: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

• Not happy customers

• Business logic everywhere

• Talend processing complex

• Approximate error handling

• Dashboard not efficient

• Slow integrationlost processdifficult to replaytalend not known

Page 7: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

• Increase processing reliability• Centralize business logic

• Enhance processing performance

Page 8: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

Why Akka and Scala ?

Page 9: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

Why Akka ?

• Isolate business code in actors

• Events to process

• Fault tolerance

• Supervision strategy

• Performance

Page 10: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

Why Scala ?

• Team knew Scala (a little)

• Try Scala in the company

• Scala with Akka rocks !

Page 11: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

Solution

Page 12: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

Web Service offers

FTP

1

2

3

4

Read FTP

Translate Xml in Jobs

Ask Web Service for diff

Save

TalendAkka

offers

offers

Page 13: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

Supervision

• Every single actor has a default supervisor strategy

• Means manage Actors failures

• Send a notification to its supervisor

• Clean separation of processing and error handling

Page 14: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

Actor system

Actor1 Actor2

A D

B C

A

B CException

Page 15: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

Page 16: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

MasterSupervisor

FileSystem Supervisor

FileCrawler

Xml Supervisor

XmlReader

Posting Supervisor

DiffActorPosting Service

Syslog

DeadLetterListener

WorkStatus

Page 17: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

DevOps

Page 18: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

• No guarantee on message delivery

• Have some metrics :

‣ Logs

‣ Metrics with Graphite

‣ Ostrich (Twitter)

‣ Kamon IO

Page 19: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

Page 20: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

Page 21: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

Page 22: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

Page 23: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

• Endpoints access with Spray :

‣ Statistics

‣ HealthCheck

‣ Workflow state

Page 24: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

Issues and key learnings

Page 25: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

• Actor system design

• An actor with lots of processing

• Unit testing

• Actors and Futures

Page 26: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

• Mind shift

• Business events

• Delegate to actors

• Isolate business rules

• Behaviour testing

Page 27: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

Results

Page 28: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

• In production

• Proactive way

• Processing time

• Web Service to optimize

• FTP to remove

Page 29: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

Conclusion

Page 30: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

• Akka is very powerful

‣ Complex underlying notions

‣ Active ecosystem

• KISS

Page 31: Supervise your Akka actors - Devoxx

@njozwiak#Devoxx #SuperviseAkka

Thank youfor watching