Supervise your Akka actors - Devoxx
-
Upload
xebia-france -
Category
Software
-
view
424 -
download
0
description
Transcript of Supervise your Akka actors - Devoxx
@njozwiak#Devoxx #SuperviseAkka
Supervise your Akka actorsNicolas Jozwiak
Xebia
@njozwiak#Devoxx #SuperviseAkka
Who am I
Programmer and agiliste
@njozwiak
@njozwiak#Devoxx #SuperviseAkka
Agenda
• Context
• Why Akka and Scala ?
• Solution
• DevOps
• Issues and key learnings
• Results
@njozwiak#Devoxx #SuperviseAkka
Context
@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
@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
@njozwiak#Devoxx #SuperviseAkka
• Increase processing reliability• Centralize business logic
• Enhance processing performance
@njozwiak#Devoxx #SuperviseAkka
Why Akka and Scala ?
@njozwiak#Devoxx #SuperviseAkka
Why Akka ?
• Isolate business code in actors
• Events to process
• Fault tolerance
• Supervision strategy
• Performance
@njozwiak#Devoxx #SuperviseAkka
Why Scala ?
• Team knew Scala (a little)
• Try Scala in the company
• Scala with Akka rocks !
@njozwiak#Devoxx #SuperviseAkka
Solution
@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
@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
@njozwiak#Devoxx #SuperviseAkka
Actor system
Actor1 Actor2
A D
B C
A
B CException
@njozwiak#Devoxx #SuperviseAkka
@njozwiak#Devoxx #SuperviseAkka
MasterSupervisor
FileSystem Supervisor
FileCrawler
Xml Supervisor
XmlReader
Posting Supervisor
DiffActorPosting Service
Syslog
DeadLetterListener
WorkStatus
@njozwiak#Devoxx #SuperviseAkka
DevOps
@njozwiak#Devoxx #SuperviseAkka
• No guarantee on message delivery
• Have some metrics :
‣ Logs
‣ Metrics with Graphite
‣ Ostrich (Twitter)
‣ Kamon IO
@njozwiak#Devoxx #SuperviseAkka
@njozwiak#Devoxx #SuperviseAkka
@njozwiak#Devoxx #SuperviseAkka
@njozwiak#Devoxx #SuperviseAkka
@njozwiak#Devoxx #SuperviseAkka
• Endpoints access with Spray :
‣ Statistics
‣ HealthCheck
‣ Workflow state
@njozwiak#Devoxx #SuperviseAkka
Issues and key learnings
@njozwiak#Devoxx #SuperviseAkka
• Actor system design
• An actor with lots of processing
• Unit testing
• Actors and Futures
@njozwiak#Devoxx #SuperviseAkka
• Mind shift
• Business events
• Delegate to actors
• Isolate business rules
• Behaviour testing
@njozwiak#Devoxx #SuperviseAkka
Results
@njozwiak#Devoxx #SuperviseAkka
• In production
• Proactive way
• Processing time
• Web Service to optimize
• FTP to remove
@njozwiak#Devoxx #SuperviseAkka
Conclusion
@njozwiak#Devoxx #SuperviseAkka
• Akka is very powerful
‣ Complex underlying notions
‣ Active ecosystem
• KISS
@njozwiak#Devoxx #SuperviseAkka
Thank youfor watching