Akka · Akka Cluster

Background Processing with Akka Cluster: ClusterSingletonManager

REST services are quite commonly used in scalable architectures because they are stateless. However, in the practical world, a service is rarely just a CRUD service: for example we could also have some background processing (i.e.: downloading/parsing files, scheduled processed, triggers, etc). In this tutorial we demonstrate how to use an Akka SingletonClusterManager in a… Continue reading Background Processing with Akka Cluster: ClusterSingletonManager

REST · Spray · Tutorial

How to build a Scala REST CRUD application with Spray

In previous articles we have described how to build a REST Api with Spray and how to (de)serialize case classes with json4s. However, in order to keep things simple, we didn't always do things as suggested by spray.io. In this article we will redeem ourselves and we will describe how to build a REST CRUD… Continue reading How to build a Scala REST CRUD application with Spray

Spray · Tutorial

How to Create a Spray Custom Authenticator

Spray has a few standard authenticators already built in. However, what if the authentication we need is not supported? In this article we will describe how to create a custom authenticator in Spray. In particular, we will implement a custom client id/secret token-based authentication. Spray Authentication: how it works Spray has already some built in… Continue reading How to Create a Spray Custom Authenticator

Akka · Tutorial

Peer-to-Many Communication in Akka

The most common communication channel in Akka is Peer-to-Peer, where an individual actor sends a message directly to another individual actor actor. However, sometimes this is not enough as we may need a Peer-to-Many type of communication, where an individual actor sends a message to a group of actors. This is particularly useful when you… Continue reading Peer-to-Many Communication in Akka

Akka · Testing · Tutorial

How to test Actors with Akka TestKit and Spec2

Actors are a really powerful tool to handle concurrency thanks to their message-based model. However, they can be tricky to test: sending and processing messages is done asynchronously. Moreover, their status is hidden internally and it cannot be easily accessed to make assertions on it. The Akka Team has created a library, called akka-testkit, to… Continue reading How to test Actors with Akka TestKit and Spec2