Refcard Expansion Pack: Reactive Programming with Akka
Join the DZone community and get the full member experience.Join For Free
This week, DZone released its latest Refcard: Reactive Programming with Akka. For those of you interested in learning more about Akka or sharpening your skills, we decided to dig into the DZone archives and find some of the most popular posts we've had on the topic over the past two years:
- Here comes the time to follow some good practices when implementing actors. One of the most important rules we should follow is avoiding any blocking input/output operations, polling, busy waiting, sleeping, etc. Simply put, an actor handling a message should only depend on CPU and if it doesn't need CPU cycles it should immediately return from
receiveand let other actors to process. If we follow this rule strictly, Akka can easily handle hundreds of thousands of messages per second using just a handful of threads.
Writing correct concurrent, fault-tolerant and scalable applications is too hard. Most of the time it’s because we are using the wrong tools and the wrong level of abstraction.
Akka is an attempt to change that.
In this article we'll look at how you can connect from Scala to RabbitMQ so you can support the AMQP protocol from your applications. In this example I'll use the Play Framework 2.0 as container (for more info on this see my other article on this subject) to run the application in, since Play makes developing with Scala a lot easier. This article will also use Akka actors to send and receive the messages from RabbitMQ.
During our lab, we wanted to implement an application with Akka and Scala, because we’re going to evaluate highly performing and scalable software architectures on the JVM. In this blog we’re describing how to set up an Akka app and show a few simple demo applications.
And don't forget to download the Akka Refcard itself:
Opinions expressed by DZone contributors are their own.