Home » Tag Archives: Akka (page 3)

Tag Archives: Akka

Akka samples with scala and Spring

I was looking around recently for Akka samples with Spring and found a starter project which appeared to fit the bill well. The project however utilizes Spring-Scala which is an excellent project, but is no longer maintained. So I wanted to update the sample to use core Spring java libraries instead. So here is an attempt on a fork of ...

Read More »

Quasar and Akka – a Comparison

The actor model is a design pattern for fault-tolerant and highly scalable systems. Actors are independent worker-modules that communicate with other actors only through message-passing, can fail in isolation from other actors but can monitor other actors for failure and take some recovery measures when that happens. Actors are simple, isolated yet coordinated, concurrent workers. Actor-based design brings many benefits:     ...

Read More »

The Bet With Typesafe That Got Me Into Building Akka

Back to the drawing board: The lost lines of code on the road to Akka Streams, Akka HTTP and Akka Typed If you’ve ever been curious about how new core features are being developed and why your favorite technologies take on a certain path, you’ve reached the right place. In the new design decisions series on the Takipi blog you’ll ...

Read More »

Alternating between Spray-servlet and Spray-can

On a server you may want to deploy your application as a war. How to build a war with spray-servlet. Locally it’s easiest to run without an application server. We include both the spray-servlet and spray-can dependencies: name := "sprayApiExample" version := "1.0" scalaVersion := "2.11.6" libraryDependencies ++= { val akkaV = "2.3.9" val sprayV = "1.3.3" Seq( "io.spray" %% ...

Read More »

Building a war with spray-servlet

We will use spray-servlet to build a war file of our API. So we can run it in a java app server. I assume we already have a working REST API. We will need a web.xml, under src/main/webapp/WEB-INF/: <?xml version="1.0"?> <web-app> <listener> <listener-class>spray.servlet.Initializer</listener-class> </listener> <servlet> <servlet-name>SprayConnectorServlet</servlet-name> <servlet-class>spray.servlet.Servlet30ConnectorServlet</servlet-class> <async-supported>true</async-supported> </servlet> <servlet-mapping> <servlet-name>SprayConnectorServlet</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> </web-app> We need an sbt plugin to ...

Read More »

Building a rest api with spray

Building a rest api with akka and spray is easy. This is how I did it: SprayApiApp:                   import akka.actor.{ActorSystem, Props} import akka.io.IO import akka.pattern.ask import akka.util.Timeout import spray.can.Http import scala.concurrent.duration._ object SprayApiApp extends App { //we need an ActorSystem to host our application in implicit val system = ActorSystem("SprayApiApp") //create apiActor ...

Read More »

A reactive and performant Spray + Akka solution to “Playing with concurrency and performance in Java and Node.js”

In my previous post I examined a fictitious trading engine and compared a Java based blocking solution to a Node.js based non-blocking solution. At the end of the post I wrote that: I suspect that following the recent success of Node.js, more and more asynchronous Java libraries will start to appear. Well such libraries already exist, for example: Akka, Spray, ...

Read More »

ReactiveMongo with Akka, Scala and websockets

I was looking for a simple websocket server for one of my projects to test some stuff with reactive mongo. When looking around, though, I couldn’t really find a simple basic implementation without including a complete framework. Finally I stumbled upon one of Typesage activtor projects: http://typesafe.com/activator/template/akka-spray-websocket. Even though the name implies that spray is required, it actually uses websocket ...

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