I have a fair amount of Apache Camel (routing/mediation/orchestation engine; lightweight ESB) experience and am racking my brain trying to understand the difference between Akka:
- Dispatchers (
Dispatcher
,PinnedDispatcher
,CallingThreadDispatcher
) - Routers
- Pools
- Groups
- Event Buses
According to the docs:
Dispatchers are:
...is what makes Akka Actors “tick”, it is the engine of the machine so to speak.
But that doesn't really explain what a dispatcher is or what it's relationship to an actor is.
Routers are:
Messages can be sent via a router to efficiently route them to destination actors, known as its routees. A Router can be used inside or outside of an actor, and you can manage the routees yourselves or use a self contained router actor with configuration capabilities. But it sounds an awful lot like a dispatcher.
Pools are:
[A type of] router [that] creates routees as child actors and removes them from the router if they terminate.
Groups are:
[A type of] actor [where routees] are created externally to the router and the router sends messages to the specified path using actor selection, without watching for termination.
Event Buses are:
...a way to send messages to groups of actors
This sounds just like dispatchers and routers.
So my main concerns are:
- What is the difference between dispatchers, routers and event buses, and when to use each?
- When to use pool vs group?