Home » Tag Archives: Akka

Tag Archives: Akka

Backpressure in action with websockets and akka-streams

akka-logo

So in the previous article I showed how you could create a websocket server using akka-streams. In this follow up article we’ll look a bit closer on how backpressure works with websockets (and probably any TCP based protocol on top of akka). To show you this we’ll use the same setup as we did in the article on visualizing backpressure. ...

Read More »

Akka samples with scala and Spring

akka-logo

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

akka-logo

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

akka-logo

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

akka-logo

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

akka-logo

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

akka-logo

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”

akka-logo

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

akka-logo

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!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.