SlideShare a Scribd company logo
Introduction to
Akka Actors
with Java 8
Mememememe
memememe
Instead of more Ghz
more cores
source: http://queue.acm.org/detail.cfm?id=2181798
Another thing that has changed
Build powerful concurrent &
distributed applications
more easily.
Akka is a toolkit and runtime
for building highly concurrent,
distributed, and resilient
message-driven applications
on the JVM
”The actor model in computer science is a
mathematical model of concurrent computation
that treats actors as the universal primitives of
concurrent computation. ”
Wikipedia
The Actor Model
An Actor
and acts on them by:
• Sending messages
• Changing its state
• Changing its behavior
• Creating more actors
receives messages
The Actor hierarchy
/user
system.actorOf(props, ”my-actor”)
/user/my-actor
getContext()
.actorOf(…, ”my-child”)
/user/my-actor/my-child
Supervision
/user
/user/my-actor
🌋
Actor
Lifecycle
actorOf()
New instance -
restarted
restart
resume
stop
ActorRef
Dispatch (Actor Execution)
Actor-a
Actor-b
Thread 1
Thread 2
b
b
ba a
a
Time
Blocking
Actor-a
Actor-b
Thread 1
Thread 2
b b
a
Time
a
Actor-c
Dos and don’ts
Don’t: Put every actor under /user

Separate parts using supervisors so they can fail independently
Do: Isolate blocking 

Put blocking logic on its own thread based dispatcher
Don’t: Write all your logic inside your actors

Make what is possible ”regular” OO logic that you can set up and unit
test synchronously
Do: Make all messages immutable

Or else there will be concurrency/visibility problems
Do: Put asynchronous boundaries where it makes sense

Three tier where each tier is an actor is probably not that useful
What more is there?
Akka Cluster
Akka Streams
and cluster tools
async & back-pressured
Get started
Learn more - the docs:
http://akka.io/docs
Get help:
gitter channel:
https://gitter.im/akka/akka
mailing list:
https://groups.google.com/forum/#!forum/akka-user
Project with samples:
https://github.com/johanandren/akka-actor-java8-webinar

More Related Content

What's hot (20)

PDF
Service discovery with Eureka and Spring Cloud
Marcelo Serpa
 
PPTX
Putting Kafka In Jail – Best Practices To Run Kafka On Kubernetes & DC/OS
Lightbend
 
PPTX
Concurrency in Scala - the Akka way
Yardena Meymann
 
PDF
Akka-chan's Survival Guide for the Streaming World
Konrad Malawski
 
PDF
Why Actor-Based Systems Are The Best For Microservices
Yaroslav Tkachenko
 
PPTX
Introduction to Akka - Atlanta Java Users Group
Roy Russo
 
PDF
Akka Cluster in Production
bilyushonak
 
PDF
Akka and Kubernetes: Reactive From Code To Cloud
Lightbend
 
PPTX
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...
Reactivesummit
 
KEY
Introduction to Actor Model and Akka
Yung-Lin Ho
 
PDF
Reactive Stream Processing with Akka Streams
Konrad Malawski
 
PDF
Actor model in .NET - Akka.NET
Konrad Dusza
 
PDF
Event Driven Architecture with Apache Camel
prajods
 
PDF
Introducing Akka
Jonas Bonér
 
PDF
Scala usergroup stockholm - reactive integrations with akka streams
Johan Andrén
 
PPTX
What’s expected in Spring 5
Gal Marder
 
PPTX
Typesafe Reactive Platform: Monitoring 1.0, Commercial features and more
Legacy Typesafe (now Lightbend)
 
PPTX
Coordinating Micro-Services with Spring Cloud Contract
Omri Spector
 
PDF
Building Stateful Microservices With Akka
Yaroslav Tkachenko
 
PPTX
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Kafka
Akara Sucharitakul
 
Service discovery with Eureka and Spring Cloud
Marcelo Serpa
 
Putting Kafka In Jail – Best Practices To Run Kafka On Kubernetes & DC/OS
Lightbend
 
Concurrency in Scala - the Akka way
Yardena Meymann
 
Akka-chan's Survival Guide for the Streaming World
Konrad Malawski
 
Why Actor-Based Systems Are The Best For Microservices
Yaroslav Tkachenko
 
Introduction to Akka - Atlanta Java Users Group
Roy Russo
 
Akka Cluster in Production
bilyushonak
 
Akka and Kubernetes: Reactive From Code To Cloud
Lightbend
 
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...
Reactivesummit
 
Introduction to Actor Model and Akka
Yung-Lin Ho
 
Reactive Stream Processing with Akka Streams
Konrad Malawski
 
Actor model in .NET - Akka.NET
Konrad Dusza
 
Event Driven Architecture with Apache Camel
prajods
 
Introducing Akka
Jonas Bonér
 
Scala usergroup stockholm - reactive integrations with akka streams
Johan Andrén
 
What’s expected in Spring 5
Gal Marder
 
Typesafe Reactive Platform: Monitoring 1.0, Commercial features and more
Legacy Typesafe (now Lightbend)
 
Coordinating Micro-Services with Spring Cloud Contract
Omri Spector
 
Building Stateful Microservices With Akka
Yaroslav Tkachenko
 
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Kafka
Akara Sucharitakul
 

Similar to Introduction to akka actors with java 8 (20)

PDF
Introduction to Akka
Piotr Trzpil
 
PDF
Daniela Sfregola - Intro to Akka
Scala Italy
 
PDF
Scala Italy 2015 - An Introduction to Akka and the Actor Based Model
Daniela Sfregola
 
PDF
An Introduction to Akka
SoftwareMill
 
PDF
Akka-intro-training-public.pdf
BernardDeffarges
 
PPTX
Introduction to actor model with examples on Akka.NET
Arthur Shvetsov
 
PPTX
Fundamentals of Akka - Webinar
Knoldus Inc.
 
PDF
Introduction to the Actor Model
BoldRadius Solutions
 
PDF
Akka - A Brief Intro
Thomas Lockney
 
PDF
Akka introtalk HyScala DEC 2016
PrasannaKumar Sathyanarayanan
 
PDF
Introduction to Akka
Johan Andrén
 
PDF
Reactive programming with akka
Webdesign Factory
 
PPTX
DotNext 2020 - When and How to Use the Actor Model and Akka.NET
petabridge
 
PDF
Akka in Action: Heiko Seeburger
JAX London
 
PDF
Actor-based concurrency in a modern Java Enterprise
Alexander Lukyanchikov
 
PDF
Introduction to Akka
Knoldus Inc.
 
PPTX
Actor-based concurrency and Akka Fundamentals
Ngoc Dao
 
PPTX
Akka Actors
Dylan Forciea
 
PDF
Akka Actors: an Introduction
Roberto Casadei
 
PDF
Actors evolved- Rotem Hermon
distributed matters
 
Introduction to Akka
Piotr Trzpil
 
Daniela Sfregola - Intro to Akka
Scala Italy
 
Scala Italy 2015 - An Introduction to Akka and the Actor Based Model
Daniela Sfregola
 
An Introduction to Akka
SoftwareMill
 
Akka-intro-training-public.pdf
BernardDeffarges
 
Introduction to actor model with examples on Akka.NET
Arthur Shvetsov
 
Fundamentals of Akka - Webinar
Knoldus Inc.
 
Introduction to the Actor Model
BoldRadius Solutions
 
Akka - A Brief Intro
Thomas Lockney
 
Akka introtalk HyScala DEC 2016
PrasannaKumar Sathyanarayanan
 
Introduction to Akka
Johan Andrén
 
Reactive programming with akka
Webdesign Factory
 
DotNext 2020 - When and How to Use the Actor Model and Akka.NET
petabridge
 
Akka in Action: Heiko Seeburger
JAX London
 
Actor-based concurrency in a modern Java Enterprise
Alexander Lukyanchikov
 
Introduction to Akka
Knoldus Inc.
 
Actor-based concurrency and Akka Fundamentals
Ngoc Dao
 
Akka Actors
Dylan Forciea
 
Akka Actors: an Introduction
Roberto Casadei
 
Actors evolved- Rotem Hermon
distributed matters
 
Ad

More from Johan Andrén (18)

PDF
Next generation message driven systems with Akka
Johan Andrén
 
PDF
Buiilding reactive distributed systems with Akka
Johan Andrén
 
PDF
Next generation actors with Akka
Johan Andrén
 
PDF
Next generation message driven systems with Akka
Johan Andrén
 
PDF
Reactive stream processing using Akka streams
Johan Andrén
 
PDF
Networks and types - the future of Akka
Johan Andrén
 
PDF
Reactive streams processing using Akka Streams
Johan Andrén
 
PDF
Building reactive distributed systems with Akka
Johan Andrén
 
PDF
Akka streams - Umeå java usergroup
Johan Andrén
 
PDF
Streaming all the things with akka streams
Johan Andrén
 
PDF
Asynchronous stream processing with Akka Streams
Johan Andrén
 
PDF
Async - react, don't wait - PingConf
Johan Andrén
 
PDF
Scala frukostseminarium
Johan Andrén
 
PDF
Async – react, don't wait
Johan Andrén
 
PDF
Akka frukostseminarium
Johan Andrén
 
PDF
Macros and reflection in scala 2.10
Johan Andrén
 
PDF
Introduction to Scala
Johan Andrén
 
PDF
Duchess scala-2012
Johan Andrén
 
Next generation message driven systems with Akka
Johan Andrén
 
Buiilding reactive distributed systems with Akka
Johan Andrén
 
Next generation actors with Akka
Johan Andrén
 
Next generation message driven systems with Akka
Johan Andrén
 
Reactive stream processing using Akka streams
Johan Andrén
 
Networks and types - the future of Akka
Johan Andrén
 
Reactive streams processing using Akka Streams
Johan Andrén
 
Building reactive distributed systems with Akka
Johan Andrén
 
Akka streams - Umeå java usergroup
Johan Andrén
 
Streaming all the things with akka streams
Johan Andrén
 
Asynchronous stream processing with Akka Streams
Johan Andrén
 
Async - react, don't wait - PingConf
Johan Andrén
 
Scala frukostseminarium
Johan Andrén
 
Async – react, don't wait
Johan Andrén
 
Akka frukostseminarium
Johan Andrén
 
Macros and reflection in scala 2.10
Johan Andrén
 
Introduction to Scala
Johan Andrén
 
Duchess scala-2012
Johan Andrén
 
Ad

Recently uploaded (20)

PDF
Module - 5 Machine Learning-22ISE62.pdf
Dr. Shivashankar
 
PPTX
Explore USA’s Best Structural And Non Structural Steel Detailing
Silicon Engineering Consultants LLC
 
PPTX
CST413 KTU S7 CSE Machine Learning Neural Networks and Support Vector Machine...
resming1
 
PDF
June 2025 - Top 10 Read Articles in Network Security and Its Applications
IJNSA Journal
 
PPTX
CST413 KTU S7 CSE Machine Learning Introduction Parameter Estimation MLE MAP ...
resming1
 
PDF
Generative AI & Scientific Research : Catalyst for Innovation, Ethics & Impact
AlqualsaDIResearchGr
 
DOCX
Engineering Geology Field Report to Malekhu .docx
justprashant567
 
PDF
Bayesian Learning - Naive Bayes Algorithm
Sharmila Chidaravalli
 
PPT
FINAL plumbing code for board exam passer
MattKristopherDiaz
 
PPTX
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
ssuser307730
 
PDF
Decision support system in machine learning models for a face recognition-bas...
TELKOMNIKA JOURNAL
 
PPTX
FSE_LLM4SE1_A Tool for In-depth Analysis of Code Execution Reasoning of Large...
cl144
 
PPTX
Work at Height training for workers .pptx
cecos12
 
PPTX
ASBC application presentation template (ENG)_v3 (1).pptx
HassanMohammed730118
 
PDF
تقرير عن التحليل الديناميكي لتدفق الهواء حول جناح.pdf
محمد قصص فتوتة
 
PPTX
Artificial Intelligence jejeiejj3iriejrjifirirjdjeie
VikingsGaming2
 
PDF
NFPA 10 - Estandar para extintores de incendios portatiles (ed.22 ENG).pdf
Oscar Orozco
 
PDF
Authentication Devices in Fog-mobile Edge Computing Environments through a Wi...
ijujournal
 
PPTX
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
AsadShad4
 
PDF
Python Mini Project: Command-Line Quiz Game for School/College Students
MPREETHI7
 
Module - 5 Machine Learning-22ISE62.pdf
Dr. Shivashankar
 
Explore USA’s Best Structural And Non Structural Steel Detailing
Silicon Engineering Consultants LLC
 
CST413 KTU S7 CSE Machine Learning Neural Networks and Support Vector Machine...
resming1
 
June 2025 - Top 10 Read Articles in Network Security and Its Applications
IJNSA Journal
 
CST413 KTU S7 CSE Machine Learning Introduction Parameter Estimation MLE MAP ...
resming1
 
Generative AI & Scientific Research : Catalyst for Innovation, Ethics & Impact
AlqualsaDIResearchGr
 
Engineering Geology Field Report to Malekhu .docx
justprashant567
 
Bayesian Learning - Naive Bayes Algorithm
Sharmila Chidaravalli
 
FINAL plumbing code for board exam passer
MattKristopherDiaz
 
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
ssuser307730
 
Decision support system in machine learning models for a face recognition-bas...
TELKOMNIKA JOURNAL
 
FSE_LLM4SE1_A Tool for In-depth Analysis of Code Execution Reasoning of Large...
cl144
 
Work at Height training for workers .pptx
cecos12
 
ASBC application presentation template (ENG)_v3 (1).pptx
HassanMohammed730118
 
تقرير عن التحليل الديناميكي لتدفق الهواء حول جناح.pdf
محمد قصص فتوتة
 
Artificial Intelligence jejeiejj3iriejrjifirirjdjeie
VikingsGaming2
 
NFPA 10 - Estandar para extintores de incendios portatiles (ed.22 ENG).pdf
Oscar Orozco
 
Authentication Devices in Fog-mobile Edge Computing Environments through a Wi...
ijujournal
 
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
AsadShad4
 
Python Mini Project: Command-Line Quiz Game for School/College Students
MPREETHI7
 

Introduction to akka actors with java 8