Appendix E. Akka and Camel
Akka aims to be the platform for the next-generation, event-driven, scalable, and fault-tolerant architectures on the JVM. One of the core features of Akka is an implementation of the Actor model. It alleviates the developer from having to deal with explicit locking and thread management. Using the Actor model raises the abstraction level and provides a better platform for building correct concurrent and scalable applications.
Akka comes with a Camel integration module that allows Akka actors to interact with communication partners over a great variety of protocols and APIs. This appendix presents selected Akka-Camel integration features by example. In particular, it covers the following:
- An introduction to Akka’s Actor API
- Implementing consumer actors for receiving messages from Camel endpoints
- Implementing producer actors for sending messages to Camel endpoints
- Using and customizing Akka’s CamelService
- Camel’s ActorComponent for exchanging messages with actors
We’ll also look at a complete routing example that combines many of the features presented in this appendix.