Akka

How to handle multipart and non multipart request together in Spray

Reading Time: 2 minutes In this blog, I will explain that how can we handle multipart and non multipart request together. It is not necessary that we will get only one type of request either multipart or non multipart all the time. We can get either both of two. So we have to handle both type of request. If we will handle only one type of request then if Continue Reading

How to extract data from multipart/mixed request in Spray

Reading Time: < 1 minute If you are getting multipart/mixed response then how should we handle that in spray so that we can extract all the data from that. Suppose we are getting email request in which contains all the information such as: from , to, attachment etc. So here is the way to extract those : entity(as[MultipartContent]) { emailData => post { val dataInParts = emailData.parts.seq map { emailPart Continue Reading

Monthly Scala News Letter : December 2013

Reading Time: < 1 minute We have started our Monthly Scala News Letter from last 2 months which is delivered to subscriber’s email address on 25th of every month. If you haven’t subscribed to the newsletter yet then make it hurry and click on Subscribe Scala Monthly News Letter In the newsletter, you will find some very useful scala business news. The main aim of newsletter is that people should Continue Reading

Create Akka project (2.2.3) with latest sbt (0.13) and scala (2.10.3)

Reading Time: 2 minutes In this blog, i will explain that how to create Akka project with the latest sbt and scala. As we know, Now latest Akka version is 2.2.3, sbt is 0.13 and scala is 2.10.3 So lets start to create the project : First of all, install the latest sbt and scala on your system then create sbt project by following the below steps : First Continue Reading

A simple way to Customize Kryo Serializer for Akka Actors in Scala

Reading Time: < 1 minute Kryo is a fastest and efficient way to do serialization. It is more efficient than Java serialization – both in size and speed. I am working on a Scala_Lift_Akka based project, where I have to implement serializer for Akka Actor’s remoting. Since Kryo is fast, efficient and easy to use, so I decided to implement Kryo in my project for serialization. I implemented Romix’s kryo-based Continue Reading

Bridging the Communication between Lift Comet Actor and Akka Actor in Scala

Reading Time: 2 minutes In this blog, I would explain how to create bridge between Lift Comet Actor and Akka Actor. Since Lift has its own actor model, so a bridge is needed to fill communication gap between LiftComet and Akka Actor, so that Akka actor would be able send message to comet, once comet has been set. This bridging concept would be more useful for those web applications, Continue Reading

A Simple Remote Chat application using Lift Comet and Akka Actor in Scala

Reading Time: 2 minutes If you are running an application and there are lot of chances for a huge traffic to come in future, a single server would not be capable to handle this. In that case you would have two choices: A) Replace existing server with an advance server with better configuration B) Building a global node in the cluster to be used by other nodes. We know Continue Reading

Easiest Way to Recover Akka Actor for Remote Application JVM Failure Scenario in Scala

Reading Time: 2 minutes In this blog, I would explain how easily you can recover Akka actor for Remote Application JVM failure scenario in Scala. I have implemented this in one of my project and it is working fine. Suppose there is a remote application, which is being used by multi JVMs, and JVMs are passing message to each other through Akka actor, then there must be an Akka Continue Reading

A simple way to implement Retry Support For Akka Future in Scala

Reading Time: < 1 minute [Note: This blog has been updated on 22nd August 2013, after the valuable feedback of readers.] In this blog, I have explained a simple way to implement retry support for Akka future in Scala. When Akka actor dies for any reason and we try to receive response from Akka future, this implementation would work. Here is the logic: object RetrySupport { def retry(actorRef: ActorRef, message: Continue Reading