Home » Tag Archives: Akka (page 4)

Tag Archives: Akka

Akka Notes – DeathWatch – 7

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

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

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

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

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

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

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 »

Akka Notes – Introducing Actors

Anyone who has done multithreading in the past won’t deny how hard and painful it is to manage multithreaded applications. I said manage because it starts out simple and it became a whole lot of fun once you start seeing performance improvements. However, it aches when you see that you don’t have a easier way to recover from errors in ...

Read More »

Monitoring Akka with Kamon

I like the JVM a lot because there are a lot of tools available for inspecting a running JVM instance at runtime. The Java Mission Control (jmc) is one of my favorite tools, when it comes to monitor threads, hot methods and memory allocation. However these tools are of limited use, when monitoring an event-driven, message-based system like Akka. A ...

Read More »

Akka Cluster with Docker containers

This article will show you how to build docker images that contain a single akka cluster application. You will be able to run multiple seed nodes and multiple cluster nodes. The code can be found on Github and will be available as a Typesafe Activator. If you don’t know docker or akka Docker is the new shiny star in the devops world. ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns