SlideShare a Scribd company logo
1 of 87
INTRODUCTION TO AKKA 
Roy Russo 
1
Who am I? 
• Former JBoss Portal Co-Founder 
• LoopFuse Co-Founder 
• ElasticHQ Founder 
• http://www.elastichq.org 
• Co-Author, Elasticsearch In Action 
• Chief Architect, Altisource Labs 
• VP Engineering, Predikto 
2
Agenda 
• The case for an Actor Model 
• Akka 
• Actor Systems 
• Deployment Diagrams 
3
Moore’s Law 
The number of transistors on a chip will double 
approximately every 18 months. 
~ Gordon Moore, 1965 
4
Moore’s Law 
5
Moore’s Law 
• Early 2000: 
• Chips got BIG 
• Signals couldn’t reach whole chip in one clock 
cycle. 
• Heat dissipation issues. 
6
Moore’s Law 
7 
• Multi-core processors 
• Multiple calculations in parallel 
• CPU speeds are likely to not increase any time soon.
The Free Lunch is Over 
8 
• Build your applications to… 
• take advantage of advances in new processors. 
• take advantage of distributed computing. 
• operate in a concurrent fashion!
Parallelize! 
• Parallelism: When two threads are executing 
simultaneously. 
9
Threads 
10 
• Shared (mutable) state 
• Deadlocks 
• LiveLocks 
• Thread Starvation 
• Race Condition
“95% of synchronized 
code is broken. The 
other 5% is written by 
Brian Goetz.” 
11
Is Joe Armstrong Right? 
• The world is concurrent. Things happen in parallel. 
• Groups of people have no shared state. 
• You have your memory. I have mine. 
• Communication by messages; sound, light. 
• State updates based on messages. 
• Sh*t happens. (Things Fail) 
• From: https://pragprog.com/articles/erlang 
12
Alternatives? 
13 
Software Transactional Memory (STM) 
Message-Passing Concurrency (Actors) 
Dataflow Concurrency
14 
ACTORS
Actors 
• From a 1973 paper, written by Carl Hewitt 
• Erlang, Occam, Oz 
• Encapsulate state and behavior 
• Implement Message-Passing Concurrency 
15
• Share Nothing. 
• No need to synchronize. 
• Isolated. Lightweight event-based Processes. 
• ~ 6.5m on 4GB RAM 
• Communicate through Messages. 
• Asychronous and Non-Blocking 
• Messages are immutable 
• Each actor has a mailbox (message queue) 
• Supervision-based failure management. 
16 
Actor Model of Concurrency
17
18
Akka 
Akka is a toolkit for building 
Concurrent 
Distributed 
Fault-Tolerant 
applications. 
19 
Actors 
Remoting 
Supervision
When to Akka? 
• When you need to build a system that: 
• reacts to Events … Event-Driven 
• reacts to Load … Scalable 
• reacts to Failure … Resilient 
• reacts to Users … Responsive 
20 
REACTIVE APPLICATIONS
Actor System 
Chat Architecture 
21 
Cassandra 
Cluster 
Elasticsearch 
Cluster 
User 1 
websocket 
Controllers 
Services 
Users 
websocket 
async 
async async 
async
Akka Actor 
22 
mailbox • Lightweight object 
Actor 
Behavior 
State 
• ~300 bytes/instance 
• Keeps internal state 
• Asynch / non-blocking 
• Messages kept in mailbox 
• Persistence 
• Small call stack = 
• Scalable and fast
23 
When an actor receives a message… 
• Actors can: 
• Create new Actors 
• Sends messages to 
Actors 
• Designate how it should 
handle the next message 
Actor 
Behavior 
State 
mailbox
24 
Scale UP & OUT 
AKKA 
Concurrent (more cores) 
Distributed (more nodes)
Some code, for the bored… 
25
Sample pom 
26 
<dependency> 
<groupId>com.typesafe.akka</groupId> 
<artifactId>akka-actor_2.10</artifactId> 
<version>${akka.version}</version> 
</dependency> 
<dependency> 
<groupId>com.typesafe.akka</groupId> 
<artifactId>akka-persistence-experimental_2.10</artifactId> 
<version>${akka.version}</version> 
</dependency> 
<dependency> 
<groupId>com.typesafe.akka</groupId> 
<artifactId>akka-cluster_2.10</artifactId> 
<version>${akka.version}</version> 
</dependency> 
<dependency> 
<groupId>com.typesafe.akka</groupId> 
<artifactId>akka-slf4j_2.10</artifactId> 
<version>${akka.version}</version> 
</dependency> 
<dependency> 
<groupId>org.scala-lang</groupId> 
<artifactId>scala-library</artifactId> 
<version>${scala.version}</version> 
</dependency>
Actor System 
27 
• Actors created within this context/container. 
• Manage shared facilities: 
• scheduling, logging, configuration, etc… 
• Can have many per JVM with different configs 
• Can contain millions of actors.
Actor System 
28 
public void init() throws Exception { 
actorSystem = ActorSystem.create("chatActorSystem"); 
}
Actor System 
29 
<bean id="actorSystemService" class="com.streamproject.akka.ActorSystemService" 
init-method="init" destroy-method="destroy"> 
</bean> 
On app-boot with Spring… (applicationContext.xml)
Actor System 
30 
/** 
* Note that this will throw on servlet container shutdown. They are false alarms in Tomcat regarding 
* Threads not being terminated correctly. The Thread.sleep call is merely here to make the noise less 
* noisy. 
*/ 
public void destroy() throws Exception { 
actorSystem.shutdown(); 
Thread.sleep(5000); 
}
Actor System - Configuration 
31 
akka { 
application.conf || application.json || application.properties 
# Loggers to register at boot time (akka.event.Logging$DefaultLogger logs 
# to STDOUT) 
loggers = ["akka.event.slf4j.Slf4jLogger"] 
# Log level used by the configured loggers (see "loggers") as soon 
# as they have been started; before that, see "stdout-loglevel" 
# Options: OFF, ERROR, WARNING, INFO, DEBUG 
loglevel = "DEBUG" 
# Log level for the very basic logger activated during ActorSystem startup. 
# This logger prints the log messages to stdout (System.out). 
# Options: OFF, ERROR, WARNING, INFO, DEBUG 
stdout-loglevel = "DEBUG" 
actor { 
provider = "akka.cluster.ClusterActorRefProvider" 
… 
}
Actor System - Configuration 
32 
• Custom config naming/loading 
• Configuration by string 
• Override configuration values 
myconfig.conf 
public void init() throws Exception { 
Config conf = ConfigFactory.load(“myconfig”); 
actorSystem = ActorSystem.create(“chatActorSystem”, conf); 
}
Actor System 
33 
Actor System 
Actor System location transparency 
Event 
• Remote and local process 
actors treated the same 
• Unified prog. model for 
multicore and distributed 
computing 
msg
ActorRef 
34 
ActorRef Mailbox 
Actor 
Instance 
Points to Actor. 
Delivers to Mailbox
Mailbox 
35 
ActorRef Mailbox 
Actor 
Instance 
Invokes Actor Instance with Message. 
Runs on a dispatcher - abstracts threading
Actor Instance 
36 
ActorRef Mailbox 
Your Code Here 
Actor 
Instance
The 4 Actor Operations 
37
The 4 Actor Operations 
• DEFINE 
1. CREATE 
2. SEND 
3. BECOME 
4. SUPERVISE 
38
DEFINE 
39 
public class MyActor extends UntypedActor { 
public void onReceive(Object message) throws Exception { 
} 
}
CREATE 
40 
Creates a top-level Actor 
ActorSystem mySystem = ActorSystem.create("MyActorSystem"); 
ActorRef myActor = mySystem.actorOf(new Props(MyActor.class),"myActor");
DEFINE - non-default constructor 
41 
public class PersistEventProcessor extends UntypedActor { 
private SearchService searchService; 
public PersistEventProcessor(SearchService searchService) { 
this.messageEventService = messageEventService; 
this.searchService = searchService; 
} 
@Override 
public void onReceive(Object obj) throws Exception {…} 
}
42 
CREATE - non-default constructor 
final ActorRef actorRef = actorSystemService.getActorSystem() 
.actorOf(Props.create(PersistEventProcessor.class, searchService)); 
actorRef.tell(new PersistMessageEventCommand(event), null);
CREATE - Child Actor 
43 
public class SupervisorActor extends UntypedActor 
{ 
ActorRef myChildActor = getContext().actorOf(new 
Props(MyChildActor.class), “myChildActor” + 
UUID.randomUUID()); 
}
SEND 
44 
• Fire and Forget 
• Asynch 
• No expected reply 
• tell() 
• Send and Receive 
• Asynch 
• Expects reply (Future) 
• ask()
SEND - tell() 
45 
actor.tell(message); 
// Explicit passing of sender actor reference 
actor.tell(msg, getSelf());
SEND - ask() 
46 
import static akka.patterns.Patterns.ask; 
Future<Object> future = ask(actor, message, timeout); 
future.onSuccess(new OnSuccess<Object>() { 
public void onSuccess(String result) { 
System.out.println(result); 
} 
}); 
more on Futures in a bit…
SEND - An ask() reply 
47 
try { 
String result = operation(); 
getSender().tell(result, getSelf()); 
} catch (Exception e) { 
getSender().tell(new akka.actor.Status.Failure(e), getSelf()); 
throw e; 
}
BECOME 
48 
• Dynamically redefines actor behavior 
• Reactively triggered by message 
• Like changing an interface, or implementation on-the-fly
BECOME 
49 
public class PingPongActor extends UntypedActor { 
static String PING = "PING"; 
static String PONG = "PONG"; 
int count = 0; 
public void onReceive(Object message) throws Exception { 
if (message instanceof String) { 
if (((String) message).matches(PING)) { 
System.out.println("PING"); 
count += 1; 
Thread.sleep(100); 
getSelf().tell(PONG); 
getContext().become(new Procedure<Object>() { 
public void apply(Object message) { 
if (message instanceof String) { 
// do Something 
} 
} 
} 
}); 
if (count > 10) 
getContext().stop(getSelf()); 
…
SUPERVISE 
• Manage another actor’s failure 
• Supervisors receive notifications, and can react upon 
failure 
• Every actor has a default supervisor strategy 
• Can be overriden 
• OneForOneStrategy (def) 
• AllForOneStrategy 
50
SUPERVISE 
51 
• On Failure, a supervisor defines what happens next: 
• resume child, and keep internal state 
• restart child, and wipe internal state 
• stop child permanently 
• stop itself and escalate the error 
• AllForOneStrategy, affects all children.
SUPERVISE 
52 
public class Supervisor extends UntypedActor { 
private static SupervisorStrategy strategy = 
new OneForOneStrategy(10, Duration.create("1 minute"), 
new Function<Throwable, Directive>() { 
@Override 
public Directive apply(Throwable t) { 
if (t instanceof ArithmeticException) { 
return resume(); 
} else if (t instanceof NullPointerException) { 
return restart(); 
} else if (t instanceof IllegalArgumentException) { 
return stop(); 
} else { 
return escalate(); 
} 
} 
}); 
@Override 
public SupervisorStrategy supervisorStrategy() { 
return strategy; 
}
SUPERVISE 
53 
http://doc.akka.io/docs/akka/snapshot/java/fault-tolerance-sample.html
SUPERVISE 
• A contrast to Failure Management in Java 
• You get one thread to control. 
• If the thread blows up, then what? 
• Defensive programming: 
• Mix error handling within the thread 
• == tangled business logic + error handling 
• Errors don’t propagate between threads 
54
Stopping Actors 
55 
//first option of shutting down the actors by shutting down the ActorSystem 
system.shutdown(); 
//second option of shutting down the actor by sending a poisonPill message 
actor.tell(PoisonPill.getInstance()); 
//third option of shutting down the actor 
getContext().stop(getSelf()); 
//or 
getContext().stop(childActorRef);
Killing Actors 
56 
actor.tell(Kill.getInstance()); 
• Synchronous 
• Sends ActorKilledException to parent
UntypedActor API 
• getSelf() : me 
• getSender() : reply-to 
• getContext() : 
• factory for child actors 
• get parent 
• system the actor belongs to 
• supervisionStrategy() 
• onReceive(msg) 
57
UntypedActor API 
58 
public void preStart() { 
} 
public void preRestart(Throwable reason, scala.Option<Object> message) { 
for (ActorRef each : getContext().getChildren()) { 
getContext().unwatch(each); 
getContext().stop(each); 
} 
postStop(); 
} 
public void postRestart(Throwable reason) { 
preStart(); 
} 
public void postStop() { 
}
Actor LifeCycle 
59
Message Delivery 
60 
• At-Most-Once (Akka) 
• At-Least-Once (Akka Persistence) 
• Exactly Once 
• What’s the definition of “Guaranteed Delivery”? 
ActorRef Mailbox 
Actor 
Instance 
Invokes Actor Instance with Message. 
Runs on a dispatcher - abstracts threading
An Example 
61 
public class UserLoginProcessor extends UntypedActor { 
LoggingAdapter log = Logging.getLogger(getContext().system(), this); 
CoreUserDetailsServiceImpl coreUserDetailsService; 
public UserLoginProcessor(CoreUserDetailsServiceImpl userDetailsService) { 
coreUserDetailsService = userDetailsService; 
} 
@Override 
public void onReceive(Object message) throws Exception { 
if (message instanceof ProcessLoginCommand) { 
SomeEvent someEvent = ((ProcessLoginCommand) message).getSomeEvent(); 
User user = UserDTOUtil.fromDTOToUser(someEvent.getUserDTO()); 
coreUserDetailsService.updateLoginTS(user); 
} else if (message instance ProcessLogoutCommand) { … } 
} 
} 
Akka Logging 
non-def constructor 
Command-based messaging
An Example 
62 
public class ProcessLoginCommand extends BaseCommand { 
private StreamEvent streamEvent; 
public ProcessLoginCommand(Object streamEvent) { 
super(streamEvent); 
this.streamEvent = (StreamEvent) streamEvent; 
} 
public StreamEvent getStreamEvent() { 
return streamEvent; 
} 
} 
public class BaseCommand<T> { 
private T commandObject; 
public BaseCommand(T commandObject) { 
this.commandObject = commandObject; 
} 
public T getCommandObject() { 
return commandObject; 
} 
}
An Example 
63 
@Autowired 
private CoreUserDetailsServiceImpl userService; 
@Override 
public void processInboundEvent(StreamEvent event) { 
switch (event.getEventType()) { 
case EventType.USER_LOGIN: { 
final ActorRef actorRef = actorSystemService.getActorSystem() 
.actorOf(Props.create(UserLoginProcessor.class, userService), "login-processor 
actorRef.tell(new ProcessLoginCommand(event), null); 
…
An Example 
64 
public class UserLoginProcessor extends UntypedActor { 
LoggingAdapter log = Logging.getLogger(getContext().system(), 
this); 
CoreUserDetailsServiceImpl coreUserDetailsService; 
public UserLoginProcessor(CoreUserDetailsServiceImpl 
userDetailsService) { 
coreUserDetailsService = userDetailsService; 
} 
… 
}
Dispatchers 
65 
• Control execution flow 
• based on the Java Executor framework 
(java.util.concurrent) 
• ThreadPoolExecutor: Executes each submitted task 
using thread from a predefined and configured thread 
pool. 
• ForkJoinPool: Same thread pool model but 
supplemented with work stealing. Threads in the pool 
will find and execute tasks (work stealing) created by 
other active tasks or tasks allocated to other threads in 
the pool that are pending execution.
Dispatchers 
66
Dispatchers 
67 
default-dispatcher { 
type = "Dispatcher" 
executor = "fork-join-executor" 
fork-join-executor { 
parallelism-min = 8 
parallelism-factor = 3.0 
parallelism-max = 64 
} 
thread-pool-executor { 
keep-alive-time = 60s 
core-pool-size-min = 8 
core-pool-size-factor = 3.0 
core-pool-size-max = 64 
max-pool-size-min = 8 
max-pool-size-factor = 3.0 
max-pool-size-max = 64 
task-queue-size = -1 
task-queue-type = "linked" 
allow-core-timeout = on 
…
Dispatcher 
68
Pinned Dispatcher 
69
Balancing Dispatcher 
70
Mailbox Types 
71 
• Backed by queue impl. from java.util.concurrent 
bounded-mailbox { 
mailbox-type = "akka.dispatch.BoundedMailbox" 
mailbox-capacity = 1000 
}
Priority Mailboxes 
72 
public class MyPrioMailbox extends UnboundedPriorityMailbox { 
// needed for reflective instantiation 
public MyPrioMailbox(ActorSystem.Settings settings, Config config) { 
// Create a new PriorityGenerator, lower prio means more important 
super(new PriorityGenerator() { 
@Override 
public int gen(Object message) { 
if (message.equals("highpriority")) 
return 0; // 'highpriority messages should be treated first if possible 
else if (message.equals("lowpriority")) 
return 2; // 'lowpriority messages should be treated last if possible 
else if (message.equals(PoisonPill.getInstance())) 
return 3; // PoisonPill when no other left 
else 
return 1; // By default they go between high and low prio 
} 
}); 
} 
}
Routers 
73
Routers 
74 
• Round-Robin Router 
• Random Router 
• Smallest Mailbox Router 
• Broadcast Router 
ActorRef router = system.actorOf(new Props(MyActor.class). 
withRouter(new RoundRobinRouter(nrOfInstances)),"myRouterActor"); 
int lowerBound = 2; 
int upperBound = 15; 
DefaultResizer resizer = new DefaultResizer(lowerBound, upperBound); 
ActorRef randomRouter = _system.actorOf(new Props(MsgEchoActor.class). withRouter(
Futures 
75 
Blocking! 
Timeout timeout = new Timeout(Duration.create(5, "seconds")); 
Future<Object> future = Patterns.ask(actor, msg, timeout); 
String result = (String) Await.result(future, timeout.duration()); 
• Callbacks: onSuccess, onFailure, onComplete 
Future<Integer> future = future(new Callable<Integer>() { 
public Integer call() { 
return 1 / 0; 
} 
}, ec).recover(new Recover<Integer>() { 
public Integer recover(Throwable problem) throws Throwable { 
if (problem instanceof ArithmeticException) 
return 0; 
else 
throw problem; 
} 
}, ec);
Persistence 
• Experimental (from “Eventsourced”) 
• Plugins: LevelDB, MongoDB, Cassandra, etc.. 
• Architecture: 
• PersistentActor 
• Journal 
• AtLeastOnce Delivery 
• Snapshots 
76 
• Event Sourcing (http://martinfowler.com/eaaDev/EventSourcing.html) 
Some Code…
No Persistence 
77 
count = 0
No Persistence 
78 
count = 1 
CRASH!
No Persistence 
79 
count = 0 
RESTART!
No Persistence 
80 
count =1 
Restarted
No Persistence 
81 
count =1 
WRONG! 
expected count == 2
With Persistence 
82 
Journal DB 
Restarted 
count =0
With Persistence 
83 
Journal DB 
Restarted 
count = 2
Example: Event-Sourcing 
84
Event Bus 
85 
• Used internally by Akka: Event Stream, Dead Letters, 
Logging, etc… 
• Remember: No Sender access! 
public boolean subscribe(Subscriber subscriber, Classifier to); 
public boolean unsubscribe(Subscriber subscriber, Classifier from); 
public void unsubscribe(Subscriber subscriber); 
public void publish(Event event); 
Some Code…
Stuff I didn’t cover 
• Testing 
• Typed Actors 
• Application Monitoring 
• MANY Configuration options 
86 
• http://doc.akka.io/docs/akka/snapshot/general/configurati 
on.html
Questions? 
87 
• Beginner Examples: https://github.com/royrusso/akka-java- 
examples 
• Akka Java Doc: 
http://doc.akka.io/docs/akka/snapshot/java.html

More Related Content

What's hot

Producer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache KafkaProducer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache KafkaJiangjie Qin
 
Universal metrics with Apache Beam
Universal metrics with Apache BeamUniversal metrics with Apache Beam
Universal metrics with Apache BeamEtienne Chauchot
 
Real-time Stream Processing with Apache Flink
Real-time Stream Processing with Apache FlinkReal-time Stream Processing with Apache Flink
Real-time Stream Processing with Apache FlinkDataWorks Summit
 
Getting Started with Confluent Schema Registry
Getting Started with Confluent Schema RegistryGetting Started with Confluent Schema Registry
Getting Started with Confluent Schema Registryconfluent
 
Reliability Guarantees for Apache Kafka
Reliability Guarantees for Apache KafkaReliability Guarantees for Apache Kafka
Reliability Guarantees for Apache Kafkaconfluent
 
ksqlDB - Stream Processing simplified!
ksqlDB - Stream Processing simplified!ksqlDB - Stream Processing simplified!
ksqlDB - Stream Processing simplified!Guido Schmutz
 
Reactive stream processing using Akka streams
Reactive stream processing using Akka streams Reactive stream processing using Akka streams
Reactive stream processing using Akka streams Johan Andrén
 
Tuning Apache Kafka Connectors for Flink.pptx
Tuning Apache Kafka Connectors for Flink.pptxTuning Apache Kafka Connectors for Flink.pptx
Tuning Apache Kafka Connectors for Flink.pptxFlink Forward
 
Evening out the uneven: dealing with skew in Flink
Evening out the uneven: dealing with skew in FlinkEvening out the uneven: dealing with skew in Flink
Evening out the uneven: dealing with skew in FlinkFlink Forward
 
Database in Kubernetes: Diagnostics and Monitoring
Database in Kubernetes: Diagnostics and MonitoringDatabase in Kubernetes: Diagnostics and Monitoring
Database in Kubernetes: Diagnostics and MonitoringSveta Smirnova
 
톰캣 운영 노하우
톰캣 운영 노하우톰캣 운영 노하우
톰캣 운영 노하우jieunsys
 
Building resilient scheduling in distributed systems with Spring
Building resilient scheduling in distributed systems with SpringBuilding resilient scheduling in distributed systems with Spring
Building resilient scheduling in distributed systems with SpringMarek Jeszka
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafkaemreakis
 
Schema Registry 101 with Bill Bejeck | Kafka Summit London 2022
Schema Registry 101 with Bill Bejeck | Kafka Summit London 2022Schema Registry 101 with Bill Bejeck | Kafka Summit London 2022
Schema Registry 101 with Bill Bejeck | Kafka Summit London 2022HostedbyConfluent
 
Streaming Data Pipelines With Apache Beam
Streaming Data Pipelines With Apache BeamStreaming Data Pipelines With Apache Beam
Streaming Data Pipelines With Apache BeamAll Things Open
 
Akka-intro-training-public.pdf
Akka-intro-training-public.pdfAkka-intro-training-public.pdf
Akka-intro-training-public.pdfBernardDeffarges
 
Kafka: All an engineer needs to know
Kafka: All an engineer needs to knowKafka: All an engineer needs to know
Kafka: All an engineer needs to knowThao Huynh Quang
 

What's hot (20)

Producer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache KafkaProducer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache Kafka
 
Universal metrics with Apache Beam
Universal metrics with Apache BeamUniversal metrics with Apache Beam
Universal metrics with Apache Beam
 
Kafka 101
Kafka 101Kafka 101
Kafka 101
 
Real-time Stream Processing with Apache Flink
Real-time Stream Processing with Apache FlinkReal-time Stream Processing with Apache Flink
Real-time Stream Processing with Apache Flink
 
Getting Started with Confluent Schema Registry
Getting Started with Confluent Schema RegistryGetting Started with Confluent Schema Registry
Getting Started with Confluent Schema Registry
 
kafka
kafkakafka
kafka
 
Reliability Guarantees for Apache Kafka
Reliability Guarantees for Apache KafkaReliability Guarantees for Apache Kafka
Reliability Guarantees for Apache Kafka
 
ksqlDB - Stream Processing simplified!
ksqlDB - Stream Processing simplified!ksqlDB - Stream Processing simplified!
ksqlDB - Stream Processing simplified!
 
Reactive stream processing using Akka streams
Reactive stream processing using Akka streams Reactive stream processing using Akka streams
Reactive stream processing using Akka streams
 
Tuning Apache Kafka Connectors for Flink.pptx
Tuning Apache Kafka Connectors for Flink.pptxTuning Apache Kafka Connectors for Flink.pptx
Tuning Apache Kafka Connectors for Flink.pptx
 
Evening out the uneven: dealing with skew in Flink
Evening out the uneven: dealing with skew in FlinkEvening out the uneven: dealing with skew in Flink
Evening out the uneven: dealing with skew in Flink
 
Database in Kubernetes: Diagnostics and Monitoring
Database in Kubernetes: Diagnostics and MonitoringDatabase in Kubernetes: Diagnostics and Monitoring
Database in Kubernetes: Diagnostics and Monitoring
 
톰캣 운영 노하우
톰캣 운영 노하우톰캣 운영 노하우
톰캣 운영 노하우
 
Building resilient scheduling in distributed systems with Spring
Building resilient scheduling in distributed systems with SpringBuilding resilient scheduling in distributed systems with Spring
Building resilient scheduling in distributed systems with Spring
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
 
Schema Registry 101 with Bill Bejeck | Kafka Summit London 2022
Schema Registry 101 with Bill Bejeck | Kafka Summit London 2022Schema Registry 101 with Bill Bejeck | Kafka Summit London 2022
Schema Registry 101 with Bill Bejeck | Kafka Summit London 2022
 
Streaming Data Pipelines With Apache Beam
Streaming Data Pipelines With Apache BeamStreaming Data Pipelines With Apache Beam
Streaming Data Pipelines With Apache Beam
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Akka-intro-training-public.pdf
Akka-intro-training-public.pdfAkka-intro-training-public.pdf
Akka-intro-training-public.pdf
 
Kafka: All an engineer needs to know
Kafka: All an engineer needs to knowKafka: All an engineer needs to know
Kafka: All an engineer needs to know
 

Viewers also liked

Deep Introduction to Akka
Deep Introduction to AkkaDeep Introduction to Akka
Deep Introduction to Akkapatriknw
 
Reactive programming using rx java & akka actors - pdx-scala - june 2014
Reactive programming   using rx java & akka actors - pdx-scala - june 2014Reactive programming   using rx java & akka actors - pdx-scala - june 2014
Reactive programming using rx java & akka actors - pdx-scala - june 2014Thomas Lockney
 
Akka/Actor introduction
Akka/Actor introductionAkka/Actor introduction
Akka/Actor introductionYuki Katada
 
Introduction to Akka
Introduction to AkkaIntroduction to Akka
Introduction to AkkaPiotr Trzpil
 
An Introduction to Akka
An Introduction to AkkaAn Introduction to Akka
An Introduction to AkkaSoftwareMill
 
StormMQ Introduction to AMQP, Dublin
StormMQ Introduction to AMQP, DublinStormMQ Introduction to AMQP, Dublin
StormMQ Introduction to AMQP, DublinStormMQ
 
Cloud Computing - Everything you wanted to know!
Cloud Computing - Everything you wanted to know!Cloud Computing - Everything you wanted to know!
Cloud Computing - Everything you wanted to know!Debasish Patra
 
Messaging For the Cloud and Microservices
Messaging For the Cloud and MicroservicesMessaging For the Cloud and Microservices
Messaging For the Cloud and MicroservicesRob Davies
 
C* Summit 2013: CMB: An Open Message Bus for the Cloud by Boris Wolf
C* Summit 2013: CMB: An Open Message Bus for the Cloud by Boris WolfC* Summit 2013: CMB: An Open Message Bus for the Cloud by Boris Wolf
C* Summit 2013: CMB: An Open Message Bus for the Cloud by Boris WolfDataStax Academy
 
Intro to node and non blocking io
Intro to node and non blocking ioIntro to node and non blocking io
Intro to node and non blocking ioAmy Hua
 
Introduction to Akka
Introduction to AkkaIntroduction to Akka
Introduction to AkkaJohan Andrén
 
Open Source Versions of Amazon's SNS and SQS.pptx
Open Source Versions of Amazon's SNS and SQS.pptxOpen Source Versions of Amazon's SNS and SQS.pptx
Open Source Versions of Amazon's SNS and SQS.pptxOpenStack Foundation
 
IPaaS: Cloud Integration Analysis
IPaaS: Cloud Integration AnalysisIPaaS: Cloud Integration Analysis
IPaaS: Cloud Integration AnalysisJesus Rodriguez
 
Integration in the Cloud
Integration in the CloudIntegration in the Cloud
Integration in the CloudRob Davies
 
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)Red Hat Developers
 
Cassandra Community Webinar: CMB - An Open Message Bus for the Cloud
Cassandra Community Webinar: CMB - An Open Message Bus for the CloudCassandra Community Webinar: CMB - An Open Message Bus for the Cloud
Cassandra Community Webinar: CMB - An Open Message Bus for the CloudDataStax
 
An Introduction to Akka http
An Introduction to Akka httpAn Introduction to Akka http
An Introduction to Akka httpKnoldus Inc.
 
Summer School 2013 - What is iPaaS and why it is important
Summer School 2013 - What is iPaaS and why it is importantSummer School 2013 - What is iPaaS and why it is important
Summer School 2013 - What is iPaaS and why it is importantWSO2
 

Viewers also liked (20)

Deep Introduction to Akka
Deep Introduction to AkkaDeep Introduction to Akka
Deep Introduction to Akka
 
Akka introtalk HyScala DEC 2016
Akka introtalk HyScala DEC 2016Akka introtalk HyScala DEC 2016
Akka introtalk HyScala DEC 2016
 
Reactive programming using rx java & akka actors - pdx-scala - june 2014
Reactive programming   using rx java & akka actors - pdx-scala - june 2014Reactive programming   using rx java & akka actors - pdx-scala - june 2014
Reactive programming using rx java & akka actors - pdx-scala - june 2014
 
Akka/Actor introduction
Akka/Actor introductionAkka/Actor introduction
Akka/Actor introduction
 
Introduction to Akka
Introduction to AkkaIntroduction to Akka
Introduction to Akka
 
An Introduction to Akka
An Introduction to AkkaAn Introduction to Akka
An Introduction to Akka
 
Een andere kijk op Microservices
Een andere kijk op MicroservicesEen andere kijk op Microservices
Een andere kijk op Microservices
 
StormMQ Introduction to AMQP, Dublin
StormMQ Introduction to AMQP, DublinStormMQ Introduction to AMQP, Dublin
StormMQ Introduction to AMQP, Dublin
 
Cloud Computing - Everything you wanted to know!
Cloud Computing - Everything you wanted to know!Cloud Computing - Everything you wanted to know!
Cloud Computing - Everything you wanted to know!
 
Messaging For the Cloud and Microservices
Messaging For the Cloud and MicroservicesMessaging For the Cloud and Microservices
Messaging For the Cloud and Microservices
 
C* Summit 2013: CMB: An Open Message Bus for the Cloud by Boris Wolf
C* Summit 2013: CMB: An Open Message Bus for the Cloud by Boris WolfC* Summit 2013: CMB: An Open Message Bus for the Cloud by Boris Wolf
C* Summit 2013: CMB: An Open Message Bus for the Cloud by Boris Wolf
 
Intro to node and non blocking io
Intro to node and non blocking ioIntro to node and non blocking io
Intro to node and non blocking io
 
Introduction to Akka
Introduction to AkkaIntroduction to Akka
Introduction to Akka
 
Open Source Versions of Amazon's SNS and SQS.pptx
Open Source Versions of Amazon's SNS and SQS.pptxOpen Source Versions of Amazon's SNS and SQS.pptx
Open Source Versions of Amazon's SNS and SQS.pptx
 
IPaaS: Cloud Integration Analysis
IPaaS: Cloud Integration AnalysisIPaaS: Cloud Integration Analysis
IPaaS: Cloud Integration Analysis
 
Integration in the Cloud
Integration in the CloudIntegration in the Cloud
Integration in the Cloud
 
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
 
Cassandra Community Webinar: CMB - An Open Message Bus for the Cloud
Cassandra Community Webinar: CMB - An Open Message Bus for the CloudCassandra Community Webinar: CMB - An Open Message Bus for the Cloud
Cassandra Community Webinar: CMB - An Open Message Bus for the Cloud
 
An Introduction to Akka http
An Introduction to Akka httpAn Introduction to Akka http
An Introduction to Akka http
 
Summer School 2013 - What is iPaaS and why it is important
Summer School 2013 - What is iPaaS and why it is importantSummer School 2013 - What is iPaaS and why it is important
Summer School 2013 - What is iPaaS and why it is important
 

Similar to Introduction to Akka concurrency and distributed computing framework

Akka london scala_user_group
Akka london scala_user_groupAkka london scala_user_group
Akka london scala_user_groupSkills Matter
 
Reactive Streams: Handling Data-Flow the Reactive Way
Reactive Streams: Handling Data-Flow the Reactive WayReactive Streams: Handling Data-Flow the Reactive Way
Reactive Streams: Handling Data-Flow the Reactive WayRoland Kuhn
 
Reactive for the Impatient - Mary Grygleski
Reactive for the Impatient - Mary GrygleskiReactive for the Impatient - Mary Grygleski
Reactive for the Impatient - Mary GrygleskiPolyglotMeetups
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examplesPeter Lawrey
 
Rethinking the debugger
Rethinking the debuggerRethinking the debugger
Rethinking the debuggerIulian Dragos
 
Multi-threading in the modern era: Vertx Akka and Quasar
Multi-threading in the modern era: Vertx Akka and QuasarMulti-threading in the modern era: Vertx Akka and Quasar
Multi-threading in the modern era: Vertx Akka and QuasarGal Marder
 
Groovy concurrency
Groovy concurrencyGroovy concurrency
Groovy concurrencyAlex Miller
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and ActivatorKevin Webber
 
Reactive Programming in .Net - actorbased computing with Akka.Net
Reactive Programming in .Net - actorbased computing with Akka.NetReactive Programming in .Net - actorbased computing with Akka.Net
Reactive Programming in .Net - actorbased computing with Akka.NetSören Stelzer
 
Introduction to Actor Model and Akka
Introduction to Actor Model and AkkaIntroduction to Actor Model and Akka
Introduction to Actor Model and AkkaYung-Lin Ho
 
Safe Wrappers and Sane Policies for Self Protecting JavaScript
Safe Wrappers and Sane Policies for Self Protecting JavaScript�Safe Wrappers and Sane Policies for Self Protecting JavaScript�
Safe Wrappers and Sane Policies for Self Protecting JavaScriptPhú Phùng
 
Architecting for Microservices Part 2
Architecting for Microservices Part 2Architecting for Microservices Part 2
Architecting for Microservices Part 2Elana Krasner
 
Reactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDaysReactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDaysManuel Bernhardt
 
Building a Complex, Real-Time Data Management Application
Building a Complex, Real-Time Data Management ApplicationBuilding a Complex, Real-Time Data Management Application
Building a Complex, Real-Time Data Management ApplicationJonathan Katz
 
Fact-Based Monitoring - PuppetConf 2014
Fact-Based Monitoring - PuppetConf 2014Fact-Based Monitoring - PuppetConf 2014
Fact-Based Monitoring - PuppetConf 2014Puppet
 
Real-Time Streaming with Apache Spark Streaming and Apache Storm
Real-Time Streaming with Apache Spark Streaming and Apache StormReal-Time Streaming with Apache Spark Streaming and Apache Storm
Real-Time Streaming with Apache Spark Streaming and Apache StormDavorin Vukelic
 
Akka Microservices Architecture And Design
Akka Microservices Architecture And DesignAkka Microservices Architecture And Design
Akka Microservices Architecture And DesignYaroslav Tkachenko
 
DotNext 2020 - When and How to Use the Actor Model and Akka.NET
DotNext 2020 - When and How to Use the Actor Model and Akka.NETDotNext 2020 - When and How to Use the Actor Model and Akka.NET
DotNext 2020 - When and How to Use the Actor Model and Akka.NETpetabridge
 

Similar to Introduction to Akka concurrency and distributed computing framework (20)

Akka london scala_user_group
Akka london scala_user_groupAkka london scala_user_group
Akka london scala_user_group
 
Reactive Streams: Handling Data-Flow the Reactive Way
Reactive Streams: Handling Data-Flow the Reactive WayReactive Streams: Handling Data-Flow the Reactive Way
Reactive Streams: Handling Data-Flow the Reactive Way
 
Reactive for the Impatient - Mary Grygleski
Reactive for the Impatient - Mary GrygleskiReactive for the Impatient - Mary Grygleski
Reactive for the Impatient - Mary Grygleski
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examples
 
Rethinking the debugger
Rethinking the debuggerRethinking the debugger
Rethinking the debugger
 
Multi-threading in the modern era: Vertx Akka and Quasar
Multi-threading in the modern era: Vertx Akka and QuasarMulti-threading in the modern era: Vertx Akka and Quasar
Multi-threading in the modern era: Vertx Akka and Quasar
 
Groovy concurrency
Groovy concurrencyGroovy concurrency
Groovy concurrency
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and Activator
 
Akka.Net Overview
Akka.Net OverviewAkka.Net Overview
Akka.Net Overview
 
Reactive Programming in .Net - actorbased computing with Akka.Net
Reactive Programming in .Net - actorbased computing with Akka.NetReactive Programming in .Net - actorbased computing with Akka.Net
Reactive Programming in .Net - actorbased computing with Akka.Net
 
Introduction to Actor Model and Akka
Introduction to Actor Model and AkkaIntroduction to Actor Model and Akka
Introduction to Actor Model and Akka
 
Safe Wrappers and Sane Policies for Self Protecting JavaScript
Safe Wrappers and Sane Policies for Self Protecting JavaScript�Safe Wrappers and Sane Policies for Self Protecting JavaScript�
Safe Wrappers and Sane Policies for Self Protecting JavaScript
 
Architecting for Microservices Part 2
Architecting for Microservices Part 2Architecting for Microservices Part 2
Architecting for Microservices Part 2
 
Reactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDaysReactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDays
 
Struts2 - 101
Struts2 - 101Struts2 - 101
Struts2 - 101
 
Building a Complex, Real-Time Data Management Application
Building a Complex, Real-Time Data Management ApplicationBuilding a Complex, Real-Time Data Management Application
Building a Complex, Real-Time Data Management Application
 
Fact-Based Monitoring - PuppetConf 2014
Fact-Based Monitoring - PuppetConf 2014Fact-Based Monitoring - PuppetConf 2014
Fact-Based Monitoring - PuppetConf 2014
 
Real-Time Streaming with Apache Spark Streaming and Apache Storm
Real-Time Streaming with Apache Spark Streaming and Apache StormReal-Time Streaming with Apache Spark Streaming and Apache Storm
Real-Time Streaming with Apache Spark Streaming and Apache Storm
 
Akka Microservices Architecture And Design
Akka Microservices Architecture And DesignAkka Microservices Architecture And Design
Akka Microservices Architecture And Design
 
DotNext 2020 - When and How to Use the Actor Model and Akka.NET
DotNext 2020 - When and How to Use the Actor Model and Akka.NETDotNext 2020 - When and How to Use the Actor Model and Akka.NET
DotNext 2020 - When and How to Use the Actor Model and Akka.NET
 

More from Roy Russo

Devnexus 2018
Devnexus 2018Devnexus 2018
Devnexus 2018Roy Russo
 
Dev nexus 2017
Dev nexus 2017Dev nexus 2017
Dev nexus 2017Roy Russo
 
Elasticsearch Atlanta Meetup 3/15/16
Elasticsearch Atlanta Meetup 3/15/16Elasticsearch Atlanta Meetup 3/15/16
Elasticsearch Atlanta Meetup 3/15/16Roy Russo
 
PyATL Meetup, Oct 8, 2015
PyATL Meetup, Oct 8, 2015PyATL Meetup, Oct 8, 2015
PyATL Meetup, Oct 8, 2015Roy Russo
 
Elasticsearch - DevNexus 2015
Elasticsearch - DevNexus 2015Elasticsearch - DevNexus 2015
Elasticsearch - DevNexus 2015Roy Russo
 
ElasticSearch - DevNexus Atlanta - 2014
ElasticSearch - DevNexus Atlanta - 2014ElasticSearch - DevNexus Atlanta - 2014
ElasticSearch - DevNexus Atlanta - 2014Roy Russo
 
ElasticSearch AJUG 2013
ElasticSearch AJUG 2013ElasticSearch AJUG 2013
ElasticSearch AJUG 2013Roy Russo
 
Ajug hibernate-dos-donts
Ajug hibernate-dos-dontsAjug hibernate-dos-donts
Ajug hibernate-dos-dontsRoy Russo
 

More from Roy Russo (8)

Devnexus 2018
Devnexus 2018Devnexus 2018
Devnexus 2018
 
Dev nexus 2017
Dev nexus 2017Dev nexus 2017
Dev nexus 2017
 
Elasticsearch Atlanta Meetup 3/15/16
Elasticsearch Atlanta Meetup 3/15/16Elasticsearch Atlanta Meetup 3/15/16
Elasticsearch Atlanta Meetup 3/15/16
 
PyATL Meetup, Oct 8, 2015
PyATL Meetup, Oct 8, 2015PyATL Meetup, Oct 8, 2015
PyATL Meetup, Oct 8, 2015
 
Elasticsearch - DevNexus 2015
Elasticsearch - DevNexus 2015Elasticsearch - DevNexus 2015
Elasticsearch - DevNexus 2015
 
ElasticSearch - DevNexus Atlanta - 2014
ElasticSearch - DevNexus Atlanta - 2014ElasticSearch - DevNexus Atlanta - 2014
ElasticSearch - DevNexus Atlanta - 2014
 
ElasticSearch AJUG 2013
ElasticSearch AJUG 2013ElasticSearch AJUG 2013
ElasticSearch AJUG 2013
 
Ajug hibernate-dos-donts
Ajug hibernate-dos-dontsAjug hibernate-dos-donts
Ajug hibernate-dos-donts
 

Recently uploaded

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 

Recently uploaded (20)

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 

Introduction to Akka concurrency and distributed computing framework

  • 1. INTRODUCTION TO AKKA Roy Russo 1
  • 2. Who am I? • Former JBoss Portal Co-Founder • LoopFuse Co-Founder • ElasticHQ Founder • http://www.elastichq.org • Co-Author, Elasticsearch In Action • Chief Architect, Altisource Labs • VP Engineering, Predikto 2
  • 3. Agenda • The case for an Actor Model • Akka • Actor Systems • Deployment Diagrams 3
  • 4. Moore’s Law The number of transistors on a chip will double approximately every 18 months. ~ Gordon Moore, 1965 4
  • 6. Moore’s Law • Early 2000: • Chips got BIG • Signals couldn’t reach whole chip in one clock cycle. • Heat dissipation issues. 6
  • 7. Moore’s Law 7 • Multi-core processors • Multiple calculations in parallel • CPU speeds are likely to not increase any time soon.
  • 8. The Free Lunch is Over 8 • Build your applications to… • take advantage of advances in new processors. • take advantage of distributed computing. • operate in a concurrent fashion!
  • 9. Parallelize! • Parallelism: When two threads are executing simultaneously. 9
  • 10. Threads 10 • Shared (mutable) state • Deadlocks • LiveLocks • Thread Starvation • Race Condition
  • 11. “95% of synchronized code is broken. The other 5% is written by Brian Goetz.” 11
  • 12. Is Joe Armstrong Right? • The world is concurrent. Things happen in parallel. • Groups of people have no shared state. • You have your memory. I have mine. • Communication by messages; sound, light. • State updates based on messages. • Sh*t happens. (Things Fail) • From: https://pragprog.com/articles/erlang 12
  • 13. Alternatives? 13 Software Transactional Memory (STM) Message-Passing Concurrency (Actors) Dataflow Concurrency
  • 15. Actors • From a 1973 paper, written by Carl Hewitt • Erlang, Occam, Oz • Encapsulate state and behavior • Implement Message-Passing Concurrency 15
  • 16. • Share Nothing. • No need to synchronize. • Isolated. Lightweight event-based Processes. • ~ 6.5m on 4GB RAM • Communicate through Messages. • Asychronous and Non-Blocking • Messages are immutable • Each actor has a mailbox (message queue) • Supervision-based failure management. 16 Actor Model of Concurrency
  • 17. 17
  • 18. 18
  • 19. Akka Akka is a toolkit for building Concurrent Distributed Fault-Tolerant applications. 19 Actors Remoting Supervision
  • 20. When to Akka? • When you need to build a system that: • reacts to Events … Event-Driven • reacts to Load … Scalable • reacts to Failure … Resilient • reacts to Users … Responsive 20 REACTIVE APPLICATIONS
  • 21. Actor System Chat Architecture 21 Cassandra Cluster Elasticsearch Cluster User 1 websocket Controllers Services Users websocket async async async async
  • 22. Akka Actor 22 mailbox • Lightweight object Actor Behavior State • ~300 bytes/instance • Keeps internal state • Asynch / non-blocking • Messages kept in mailbox • Persistence • Small call stack = • Scalable and fast
  • 23. 23 When an actor receives a message… • Actors can: • Create new Actors • Sends messages to Actors • Designate how it should handle the next message Actor Behavior State mailbox
  • 24. 24 Scale UP & OUT AKKA Concurrent (more cores) Distributed (more nodes)
  • 25. Some code, for the bored… 25
  • 26. Sample pom 26 <dependency> <groupId>com.typesafe.akka</groupId> <artifactId>akka-actor_2.10</artifactId> <version>${akka.version}</version> </dependency> <dependency> <groupId>com.typesafe.akka</groupId> <artifactId>akka-persistence-experimental_2.10</artifactId> <version>${akka.version}</version> </dependency> <dependency> <groupId>com.typesafe.akka</groupId> <artifactId>akka-cluster_2.10</artifactId> <version>${akka.version}</version> </dependency> <dependency> <groupId>com.typesafe.akka</groupId> <artifactId>akka-slf4j_2.10</artifactId> <version>${akka.version}</version> </dependency> <dependency> <groupId>org.scala-lang</groupId> <artifactId>scala-library</artifactId> <version>${scala.version}</version> </dependency>
  • 27. Actor System 27 • Actors created within this context/container. • Manage shared facilities: • scheduling, logging, configuration, etc… • Can have many per JVM with different configs • Can contain millions of actors.
  • 28. Actor System 28 public void init() throws Exception { actorSystem = ActorSystem.create("chatActorSystem"); }
  • 29. Actor System 29 <bean id="actorSystemService" class="com.streamproject.akka.ActorSystemService" init-method="init" destroy-method="destroy"> </bean> On app-boot with Spring… (applicationContext.xml)
  • 30. Actor System 30 /** * Note that this will throw on servlet container shutdown. They are false alarms in Tomcat regarding * Threads not being terminated correctly. The Thread.sleep call is merely here to make the noise less * noisy. */ public void destroy() throws Exception { actorSystem.shutdown(); Thread.sleep(5000); }
  • 31. Actor System - Configuration 31 akka { application.conf || application.json || application.properties # Loggers to register at boot time (akka.event.Logging$DefaultLogger logs # to STDOUT) loggers = ["akka.event.slf4j.Slf4jLogger"] # Log level used by the configured loggers (see "loggers") as soon # as they have been started; before that, see "stdout-loglevel" # Options: OFF, ERROR, WARNING, INFO, DEBUG loglevel = "DEBUG" # Log level for the very basic logger activated during ActorSystem startup. # This logger prints the log messages to stdout (System.out). # Options: OFF, ERROR, WARNING, INFO, DEBUG stdout-loglevel = "DEBUG" actor { provider = "akka.cluster.ClusterActorRefProvider" … }
  • 32. Actor System - Configuration 32 • Custom config naming/loading • Configuration by string • Override configuration values myconfig.conf public void init() throws Exception { Config conf = ConfigFactory.load(“myconfig”); actorSystem = ActorSystem.create(“chatActorSystem”, conf); }
  • 33. Actor System 33 Actor System Actor System location transparency Event • Remote and local process actors treated the same • Unified prog. model for multicore and distributed computing msg
  • 34. ActorRef 34 ActorRef Mailbox Actor Instance Points to Actor. Delivers to Mailbox
  • 35. Mailbox 35 ActorRef Mailbox Actor Instance Invokes Actor Instance with Message. Runs on a dispatcher - abstracts threading
  • 36. Actor Instance 36 ActorRef Mailbox Your Code Here Actor Instance
  • 37. The 4 Actor Operations 37
  • 38. The 4 Actor Operations • DEFINE 1. CREATE 2. SEND 3. BECOME 4. SUPERVISE 38
  • 39. DEFINE 39 public class MyActor extends UntypedActor { public void onReceive(Object message) throws Exception { } }
  • 40. CREATE 40 Creates a top-level Actor ActorSystem mySystem = ActorSystem.create("MyActorSystem"); ActorRef myActor = mySystem.actorOf(new Props(MyActor.class),"myActor");
  • 41. DEFINE - non-default constructor 41 public class PersistEventProcessor extends UntypedActor { private SearchService searchService; public PersistEventProcessor(SearchService searchService) { this.messageEventService = messageEventService; this.searchService = searchService; } @Override public void onReceive(Object obj) throws Exception {…} }
  • 42. 42 CREATE - non-default constructor final ActorRef actorRef = actorSystemService.getActorSystem() .actorOf(Props.create(PersistEventProcessor.class, searchService)); actorRef.tell(new PersistMessageEventCommand(event), null);
  • 43. CREATE - Child Actor 43 public class SupervisorActor extends UntypedActor { ActorRef myChildActor = getContext().actorOf(new Props(MyChildActor.class), “myChildActor” + UUID.randomUUID()); }
  • 44. SEND 44 • Fire and Forget • Asynch • No expected reply • tell() • Send and Receive • Asynch • Expects reply (Future) • ask()
  • 45. SEND - tell() 45 actor.tell(message); // Explicit passing of sender actor reference actor.tell(msg, getSelf());
  • 46. SEND - ask() 46 import static akka.patterns.Patterns.ask; Future<Object> future = ask(actor, message, timeout); future.onSuccess(new OnSuccess<Object>() { public void onSuccess(String result) { System.out.println(result); } }); more on Futures in a bit…
  • 47. SEND - An ask() reply 47 try { String result = operation(); getSender().tell(result, getSelf()); } catch (Exception e) { getSender().tell(new akka.actor.Status.Failure(e), getSelf()); throw e; }
  • 48. BECOME 48 • Dynamically redefines actor behavior • Reactively triggered by message • Like changing an interface, or implementation on-the-fly
  • 49. BECOME 49 public class PingPongActor extends UntypedActor { static String PING = "PING"; static String PONG = "PONG"; int count = 0; public void onReceive(Object message) throws Exception { if (message instanceof String) { if (((String) message).matches(PING)) { System.out.println("PING"); count += 1; Thread.sleep(100); getSelf().tell(PONG); getContext().become(new Procedure<Object>() { public void apply(Object message) { if (message instanceof String) { // do Something } } } }); if (count > 10) getContext().stop(getSelf()); …
  • 50. SUPERVISE • Manage another actor’s failure • Supervisors receive notifications, and can react upon failure • Every actor has a default supervisor strategy • Can be overriden • OneForOneStrategy (def) • AllForOneStrategy 50
  • 51. SUPERVISE 51 • On Failure, a supervisor defines what happens next: • resume child, and keep internal state • restart child, and wipe internal state • stop child permanently • stop itself and escalate the error • AllForOneStrategy, affects all children.
  • 52. SUPERVISE 52 public class Supervisor extends UntypedActor { private static SupervisorStrategy strategy = new OneForOneStrategy(10, Duration.create("1 minute"), new Function<Throwable, Directive>() { @Override public Directive apply(Throwable t) { if (t instanceof ArithmeticException) { return resume(); } else if (t instanceof NullPointerException) { return restart(); } else if (t instanceof IllegalArgumentException) { return stop(); } else { return escalate(); } } }); @Override public SupervisorStrategy supervisorStrategy() { return strategy; }
  • 54. SUPERVISE • A contrast to Failure Management in Java • You get one thread to control. • If the thread blows up, then what? • Defensive programming: • Mix error handling within the thread • == tangled business logic + error handling • Errors don’t propagate between threads 54
  • 55. Stopping Actors 55 //first option of shutting down the actors by shutting down the ActorSystem system.shutdown(); //second option of shutting down the actor by sending a poisonPill message actor.tell(PoisonPill.getInstance()); //third option of shutting down the actor getContext().stop(getSelf()); //or getContext().stop(childActorRef);
  • 56. Killing Actors 56 actor.tell(Kill.getInstance()); • Synchronous • Sends ActorKilledException to parent
  • 57. UntypedActor API • getSelf() : me • getSender() : reply-to • getContext() : • factory for child actors • get parent • system the actor belongs to • supervisionStrategy() • onReceive(msg) 57
  • 58. UntypedActor API 58 public void preStart() { } public void preRestart(Throwable reason, scala.Option<Object> message) { for (ActorRef each : getContext().getChildren()) { getContext().unwatch(each); getContext().stop(each); } postStop(); } public void postRestart(Throwable reason) { preStart(); } public void postStop() { }
  • 60. Message Delivery 60 • At-Most-Once (Akka) • At-Least-Once (Akka Persistence) • Exactly Once • What’s the definition of “Guaranteed Delivery”? ActorRef Mailbox Actor Instance Invokes Actor Instance with Message. Runs on a dispatcher - abstracts threading
  • 61. An Example 61 public class UserLoginProcessor extends UntypedActor { LoggingAdapter log = Logging.getLogger(getContext().system(), this); CoreUserDetailsServiceImpl coreUserDetailsService; public UserLoginProcessor(CoreUserDetailsServiceImpl userDetailsService) { coreUserDetailsService = userDetailsService; } @Override public void onReceive(Object message) throws Exception { if (message instanceof ProcessLoginCommand) { SomeEvent someEvent = ((ProcessLoginCommand) message).getSomeEvent(); User user = UserDTOUtil.fromDTOToUser(someEvent.getUserDTO()); coreUserDetailsService.updateLoginTS(user); } else if (message instance ProcessLogoutCommand) { … } } } Akka Logging non-def constructor Command-based messaging
  • 62. An Example 62 public class ProcessLoginCommand extends BaseCommand { private StreamEvent streamEvent; public ProcessLoginCommand(Object streamEvent) { super(streamEvent); this.streamEvent = (StreamEvent) streamEvent; } public StreamEvent getStreamEvent() { return streamEvent; } } public class BaseCommand<T> { private T commandObject; public BaseCommand(T commandObject) { this.commandObject = commandObject; } public T getCommandObject() { return commandObject; } }
  • 63. An Example 63 @Autowired private CoreUserDetailsServiceImpl userService; @Override public void processInboundEvent(StreamEvent event) { switch (event.getEventType()) { case EventType.USER_LOGIN: { final ActorRef actorRef = actorSystemService.getActorSystem() .actorOf(Props.create(UserLoginProcessor.class, userService), "login-processor actorRef.tell(new ProcessLoginCommand(event), null); …
  • 64. An Example 64 public class UserLoginProcessor extends UntypedActor { LoggingAdapter log = Logging.getLogger(getContext().system(), this); CoreUserDetailsServiceImpl coreUserDetailsService; public UserLoginProcessor(CoreUserDetailsServiceImpl userDetailsService) { coreUserDetailsService = userDetailsService; } … }
  • 65. Dispatchers 65 • Control execution flow • based on the Java Executor framework (java.util.concurrent) • ThreadPoolExecutor: Executes each submitted task using thread from a predefined and configured thread pool. • ForkJoinPool: Same thread pool model but supplemented with work stealing. Threads in the pool will find and execute tasks (work stealing) created by other active tasks or tasks allocated to other threads in the pool that are pending execution.
  • 67. Dispatchers 67 default-dispatcher { type = "Dispatcher" executor = "fork-join-executor" fork-join-executor { parallelism-min = 8 parallelism-factor = 3.0 parallelism-max = 64 } thread-pool-executor { keep-alive-time = 60s core-pool-size-min = 8 core-pool-size-factor = 3.0 core-pool-size-max = 64 max-pool-size-min = 8 max-pool-size-factor = 3.0 max-pool-size-max = 64 task-queue-size = -1 task-queue-type = "linked" allow-core-timeout = on …
  • 71. Mailbox Types 71 • Backed by queue impl. from java.util.concurrent bounded-mailbox { mailbox-type = "akka.dispatch.BoundedMailbox" mailbox-capacity = 1000 }
  • 72. Priority Mailboxes 72 public class MyPrioMailbox extends UnboundedPriorityMailbox { // needed for reflective instantiation public MyPrioMailbox(ActorSystem.Settings settings, Config config) { // Create a new PriorityGenerator, lower prio means more important super(new PriorityGenerator() { @Override public int gen(Object message) { if (message.equals("highpriority")) return 0; // 'highpriority messages should be treated first if possible else if (message.equals("lowpriority")) return 2; // 'lowpriority messages should be treated last if possible else if (message.equals(PoisonPill.getInstance())) return 3; // PoisonPill when no other left else return 1; // By default they go between high and low prio } }); } }
  • 74. Routers 74 • Round-Robin Router • Random Router • Smallest Mailbox Router • Broadcast Router ActorRef router = system.actorOf(new Props(MyActor.class). withRouter(new RoundRobinRouter(nrOfInstances)),"myRouterActor"); int lowerBound = 2; int upperBound = 15; DefaultResizer resizer = new DefaultResizer(lowerBound, upperBound); ActorRef randomRouter = _system.actorOf(new Props(MsgEchoActor.class). withRouter(
  • 75. Futures 75 Blocking! Timeout timeout = new Timeout(Duration.create(5, "seconds")); Future<Object> future = Patterns.ask(actor, msg, timeout); String result = (String) Await.result(future, timeout.duration()); • Callbacks: onSuccess, onFailure, onComplete Future<Integer> future = future(new Callable<Integer>() { public Integer call() { return 1 / 0; } }, ec).recover(new Recover<Integer>() { public Integer recover(Throwable problem) throws Throwable { if (problem instanceof ArithmeticException) return 0; else throw problem; } }, ec);
  • 76. Persistence • Experimental (from “Eventsourced”) • Plugins: LevelDB, MongoDB, Cassandra, etc.. • Architecture: • PersistentActor • Journal • AtLeastOnce Delivery • Snapshots 76 • Event Sourcing (http://martinfowler.com/eaaDev/EventSourcing.html) Some Code…
  • 77. No Persistence 77 count = 0
  • 78. No Persistence 78 count = 1 CRASH!
  • 79. No Persistence 79 count = 0 RESTART!
  • 80. No Persistence 80 count =1 Restarted
  • 81. No Persistence 81 count =1 WRONG! expected count == 2
  • 82. With Persistence 82 Journal DB Restarted count =0
  • 83. With Persistence 83 Journal DB Restarted count = 2
  • 85. Event Bus 85 • Used internally by Akka: Event Stream, Dead Letters, Logging, etc… • Remember: No Sender access! public boolean subscribe(Subscriber subscriber, Classifier to); public boolean unsubscribe(Subscriber subscriber, Classifier from); public void unsubscribe(Subscriber subscriber); public void publish(Event event); Some Code…
  • 86. Stuff I didn’t cover • Testing • Typed Actors • Application Monitoring • MANY Configuration options 86 • http://doc.akka.io/docs/akka/snapshot/general/configurati on.html
  • 87. Questions? 87 • Beginner Examples: https://github.com/royrusso/akka-java- examples • Akka Java Doc: http://doc.akka.io/docs/akka/snapshot/java.html

Editor's Notes

  1. He is also known for his work on the Actor model[4] of concurrent computation,[5] which influenced the development of the Scheme programming language[6] and the π calculus,[7] and served as an inspiration for several other programming languages.[8
  2. The ActorRef is immutable and has a one to one relationship with the Actor it represents. The ActorRef is also serializable and network-aware. This means that you can serialize it, send it over the wire and use it on a remote host and it will still be representing the same Actor on the original node, across the network.
  3. bounded or unbounded. FIFO ordering. provides priority mailboxes where messages are queued based on priority.
  4. bounded or unbounded. FIFO ordering. provides priority mailboxes where messages are queued based on priority.
  5. Props = configuration class. Name your actors. If the given name is already in use by another child to the same parent an InvalidActorNameException is thrown.
  6. 2 modes of sending
  7. getSelf() is a reference to the sender, and is available in the receiver as getSender(). only works if both are untyped actors.
  8. futures avoid blocking calls.
  9. 10 failures within 1 minute
  10. Failure flow: Step Description 1 The Storage throws StorageException. 2 The CounterService is supervisor of the Storage and restarts the Storage when StorageException is thrown. 3, 4, 5, 6 The Storage continues to fail and is restarted. 7 After 3 failures and restarts within 5 seconds the Storage is stopped by its supervisor, i.e. the CounterService. 8 The CounterService is also watching the Storage for termination and receives the Terminated message when the Storage has been stopped ... 9, 10, 11 and tells the Counter that there is no Storage. 12 The CounterService schedules a Reconnect message to itself. 13, 14 When it receives the Reconnect message it creates a new Storage ... 15, 16 and tells the Counter to use the new Storage
  11. stops are asynch calls. parents wait for Terminated messages from all children before stopping. poisonpill is queued like other messages.
  12. preStart called right after actor creation. during restart, its called by postRestart.
  13. cheapest, highest performance. no guaranteed delivery. requires countering transport loss - means keeping state at the sending end. message may be duplicated. requires idempotent message processing most expensive/ worst performance. requires state at both ends, to filter dupes.
  14. Executor provides the framework for the execution of asynchronous tasks. It is based on the producer–consumer model, meaning the act of task submission (producer) is decoupled from the act of task execution (consumer). The threads that submit tasks are different from the threads that execute the tasks.
  15. The dispatchers run on their threads; they dispatch the actors and messages from the attached mailbox and allocate on heap to the executor threads. The executor threads are configured and tuned to the underlying processor cores that available for processing the messages.
  16. • Every actor is backed by its own mailbox • The dispatcher can be shared with any number of actors • The dispatcher can be backed by either thread pool or fork join pool • The dispatcher is optimized for non-blocking code This is an event-based dispatcher that binds a set of actors to a thread pool backed up by a BlockingQueue method.
  17. • Every actor is backed by its own mailbox. • A dedicated thread for each actor implies that this dispatcher cannot be shared with any other actors. • The dispatcher is backed by the thread pool executor. • The dispatcher is optimized for blocking operations. For example, if the code is making I/O calls or database calls, then such actors will wait until the task is finished. For such blocking operation, the pinned dispatcher performs better than the default dispatcher. This dispatcher provides a single, dedicated thread (pinned) for each actor. This dispatcher is useful when the actors are doing I/O operations or performing long-running calculations.
  18. • There is only one mailbox for all actors • The dispatcher can be shared only with actors of the same type • The dispatcher can be backed by a either thread pool or fork join pool The balancing dispatcher, as the name suggests is an event-based dispatcher that tries to redistribute work from busy actors and allocate it to idle ones. Redistribution of tasks can only work if all actors are of the same type (requirement). The dispatcher looks for actors that are idle and dispatches the message(s) to them for processing.
  19. • Round robin router: It routes the incoming messages in a circular order to all its routees • Random router: It randomly selects a routee and routes the message to the same • Smallest mailbox router: It identifies the actor with the least number of messages in its mailbox and routes the message to the same • Broadcast router: It forwards the same message to all the routees • Scatter gather first completed router: It forwards the message to all its routees as a future, then whichever routee actor responds back, it takes the results and sends them back to the caller
  20. Await.result and Await.ready are provided for exceptional situations where you must block, a good rule of thumb is to only use them if you know why you must block.
  21. Akka persistence enables stateful actors to persist their internal state so that it can be recovered when an actor is started, restarted after a JVM crash or by a supervisor, or migrated in a cluster. The key concept behind Akka persistence is that only changes to an actor's internal state are persisted but never its current state directly (except for optional snapshots). PersistentActor: Is a persistent, stateful actor. It is able to persist events to a journal and can react to them in a thread-safe manner. It can be used to implement both command as well as event sourced actors. When a persistent actor is started or restarted, journaled messages are replayed to that actor, so that it can recover internal state from these messages. AtLeastOnceDelivery: To send messages with at-least-once delivery semantics to destinations, also in case of sender and receiver JVM crashes. Journal: A journal stores the sequence of messages sent to a persistent actor. An application can control which messages are journaled and which are received by the persistent actor without being journaled. The storage backend of a journal is pluggable. The default journal storage plugin writes to the local filesystem, replicated journals are available as Community plugins. Snapshot store: A snapshot store persists snapshots of a persistent actor's or a view's internal state. Snapshots are used for optimizing recovery times. The storage backend of a snapshot store is pluggable. The default snapshot storage plugin writes to the local filesystem.
  22. An event bus must define the following three type parameters: Event (E) is the type of all events published on that bus Subscriber (S) is the type of subscribers allowed to register on that event bus Classifier (C) defines the classifier to be used in selecting subscribers for dispatching events