Home » Tag Archives: Akka (page 2)

Tag Archives: Akka

Use reactive streams API to combine akka-streams with rxJava

akka-logo

Just a quick article this time, since I’m still experimenting with this stuff. There is a lot of talk around reactive programming. In Java 8 we’ve got the Stream API, we got rxJava we got ratpack and Akka has got akka-streams. The main issue with these implementations is that they aren’t compatible. You can’t connect the subscriber of one implementation ...

Read More »

Akka Notes – Actor Supervision – 8

akka-logo

Failures are more like a feature among distributed systems. And with Akka’s let it crash fault tolerance model, you could achieve a clear separation between your business logic and your failure handling logic (supervision logic). All with very little effort. It’s pretty amazing. This is the topic of our discussion now. Actor Supervision Imagine a method call stack and the ...

Read More »

Clustering reactmq with akka-cluster

akka-logo

In the last two posts on reactmq, I described how to write a reactive, persistent message queue. The queue has the following characteristics:                   there is a single broker storing the messages, with potentially multiple clients, either sending or receiving messages provides at-least-once-delivery; receiving a message blocks the message; unless it is ...

Read More »

Akka Notes – DeathWatch – 7

akka-logo

When we talked about Actor lifecycle, we saw that Actors could be stopped by various means (using ActorSystem.stop or ActorContext.stop or sending a PoisonPill – there’s also the Kill and the gracefulStop). Whatever reason an Actor dies, there are cases when a few other actors in the system would like to know about it. Let’s take a trivial example of ...

Read More »

From Java 7 Futures to Akka actors with Scala

akka-logo

This blog post will show you how a step by step transition from a “java 7 and j.u.c.Future” based implementation to an “akka actor written in scala solution” looks like. It will take four steps, which are:                 Java 7 and futures Java 8 and parallel streams Scala and futures Scala and actors ...

Read More »

Akka Notes – Child Actors and ActorPath – 6

akka-logo

Actors are completely hierarchical. Whatever Actors that you create HAS to be a child of some other Actor. Let’s analyze that a bit : Path Say, we create an ActorRef using ActorSystem.actorOf and try to print it’s path.       val actorSystem=ActorSystem("SupervisionActorSystem") val actorRef=actorSystem.actorOf(Props[BasicLifecycleLoggingTeacherActor]) println (actorRef.path) // (prints) akka://SupervisionActorSystem/user/$a As you see, a path looks very similar to a ...

Read More »

Akka Notes – ActorSystem (Configuration and Scheduling) – 4

akka-logo

As we saw from our previous posts, we could create an Actor using the actorOf method of the ActorSystem. There’s actually much more you could do with ActorSystem. We’ll touch upon just the Configuration and the Scheduling bit in this write-up. Let’s look at the subsets of methods available in the ActorSystem.             1. Configuration ...

Read More »

Akka Notes – Actor Messaging – Request and Response – 3

akka-logo

Last time when we saw Actor messaging, we saw how fire-n-forget messages are sent (Meaning, we just send a message to the Actor but don’t expect a response from the Actor). Technically, we fire messages to Actors for its side-effects ALL THE TIME. It is by design. Other than not responding, the target Actor could ALSO do the following with ...

Read More »

Akka Notes – Actor Logging and Testing

akka-logo

In the first two parts (one, two), we briefly talked about Actors and how messaging works. In this part, let’s look at fixing up Logging and Testing our TeacherActor. Recap This is how our Actor from the previous part looked like :           class TeacherActor extends Actor { val quotes = List( "Moderation is for cowards", ...

Read More »

Akka Notes – Actor Messaging – 1

akka-logo

From the introductory first part of the Akka Notes, we saw a bird’s eye view of Actors in the Akka Toolkit. In this second part of the Akka Notes, we’ll look at the messaging part of Actors. As for the example, we would use the same Student-Teacher example that we discussed earlier. In this first part of Actor Messaging, we’ll ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close