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

PDF
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
PDF
Akka A to Z: A Guide To The Industry’s Best Toolkit for Fast Data and Microse...
PDF
VJUG24 - Reactive Integrations with Akka Streams
PPTX
Developing distributed applications with Akka and Akka Cluster
PDF
Akka Streams - From Zero to Kafka
PPTX
Developing distributed applications with Akka and Akka Cluster
PDF
System Integration with Akka and Apache Camel
PDF
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
Akka A to Z: A Guide To The Industry’s Best Toolkit for Fast Data and Microse...
VJUG24 - Reactive Integrations with Akka Streams
Developing distributed applications with Akka and Akka Cluster
Akka Streams - From Zero to Kafka
Developing distributed applications with Akka and Akka Cluster
System Integration with Akka and Apache Camel
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...

What's hot (20)

PDF
Service discovery with Eureka and Spring Cloud
PPTX
Putting Kafka In Jail – Best Practices To Run Kafka On Kubernetes & DC/OS
PPTX
Concurrency in Scala - the Akka way
PDF
Akka-chan's Survival Guide for the Streaming World
PDF
Why Actor-Based Systems Are The Best For Microservices
PPTX
Introduction to Akka - Atlanta Java Users Group
PDF
Akka Cluster in Production
PDF
Akka and Kubernetes: Reactive From Code To Cloud
PPTX
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...
KEY
Introduction to Actor Model and Akka
PDF
Reactive Stream Processing with Akka Streams
PDF
Actor model in .NET - Akka.NET
PDF
Event Driven Architecture with Apache Camel
PDF
Introducing Akka
PDF
Scala usergroup stockholm - reactive integrations with akka streams
PPTX
What’s expected in Spring 5
PPTX
Typesafe Reactive Platform: Monitoring 1.0, Commercial features and more
PPTX
Coordinating Micro-Services with Spring Cloud Contract
PDF
Building Stateful Microservices With Akka
PPTX
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Kafka
Service discovery with Eureka and Spring Cloud
Putting Kafka In Jail – Best Practices To Run Kafka On Kubernetes & DC/OS
Concurrency in Scala - the Akka way
Akka-chan's Survival Guide for the Streaming World
Why Actor-Based Systems Are The Best For Microservices
Introduction to Akka - Atlanta Java Users Group
Akka Cluster in Production
Akka and Kubernetes: Reactive From Code To Cloud
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...
Introduction to Actor Model and Akka
Reactive Stream Processing with Akka Streams
Actor model in .NET - Akka.NET
Event Driven Architecture with Apache Camel
Introducing Akka
Scala usergroup stockholm - reactive integrations with akka streams
What’s expected in Spring 5
Typesafe Reactive Platform: Monitoring 1.0, Commercial features and more
Coordinating Micro-Services with Spring Cloud Contract
Building Stateful Microservices With Akka
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Kafka
Ad

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

PDF
Reactive programming with akka
PDF
Akka Actors: an Introduction
PDF
Build Cloud Applications with Akka and Heroku
PDF
The Cloud-natives are RESTless @ JavaOne
PDF
Testing akka-actors
PPTX
Akka Microservices Architecture And Design
PDF
PPTX
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
PPTX
DotNext 2020 - When and How to Use the Actor Model and Akka.NET
PDF
Reactor Proactor 성능분석
DOCX
J2EE-assignment
PDF
Scaling software with akka
PDF
Advanced akka features
PDF
Introduction to Actor Model and Akka
PPT
Project Description Of Incident Management System Developed by PRS (CRIS) , N...
PDF
Akka lsug skills matter
PDF
Scaling Web Apps with Akka
PDF
Struts2
KEY
Akka london scala_user_group
PPTX
Орхан Гасимов: "Reactive Applications in Java with Akka"
Reactive programming with akka
Akka Actors: an Introduction
Build Cloud Applications with Akka and Heroku
The Cloud-natives are RESTless @ JavaOne
Testing akka-actors
Akka Microservices Architecture And Design
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
DotNext 2020 - When and How to Use the Actor Model and Akka.NET
Reactor Proactor 성능분석
J2EE-assignment
Scaling software with akka
Advanced akka features
Introduction to Actor Model and Akka
Project Description Of Incident Management System Developed by PRS (CRIS) , N...
Akka lsug skills matter
Scaling Web Apps with Akka
Struts2
Akka london scala_user_group
Орхан Гасимов: "Reactive Applications in Java with Akka"
Ad

More from Johan Andrén (19)

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

Recently uploaded (20)

PDF
Well-logging-methods_new................
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
Safety Seminar civil to be ensured for safe working.
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPT
Project quality management in manufacturing
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
Geodesy 1.pptx...............................................
PDF
PPT on Performance Review to get promotions
PPTX
Sustainable Sites - Green Building Construction
PPT
Mechanical Engineering MATERIALS Selection
PDF
737-MAX_SRG.pdf student reference guides
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
Categorization of Factors Affecting Classification Algorithms Selection
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PPTX
additive manufacturing of ss316l using mig welding
Well-logging-methods_new................
Foundation to blockchain - A guide to Blockchain Tech
Safety Seminar civil to be ensured for safe working.
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Project quality management in manufacturing
Internet of Things (IOT) - A guide to understanding
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Geodesy 1.pptx...............................................
PPT on Performance Review to get promotions
Sustainable Sites - Green Building Construction
Mechanical Engineering MATERIALS Selection
737-MAX_SRG.pdf student reference guides
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Categorization of Factors Affecting Classification Algorithms Selection
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
additive manufacturing of ss316l using mig welding

Introduction to akka actors with java 8