Questions tagged [akka]

Akka is an open-source toolkit and runtime simplifying the construction of concurrent and distributed applications on the JVM. It implements the actor model known from Erlang.

From its website:

We believe that writing correct concurrent, fault-tolerant and scalable applications is too hard. Most of the time it's because we are using the wrong tools and the wrong level of abstraction. Akka is here to change that. Using the Actor Model and Software Transactional Memory, we raise the abstraction level and provide a better platform to build correct concurrent and scalable applications. For fault-tolerance, we adopt the "Let it crash" / "Embrace failure" model, which has been used with great success in the telecom industry to build applications that self-heal, and systems that never stop. Actors also provide the abstraction for transparent distribution and the basis for truly scalable and fault-tolerant applications. Akka is Open Source and available under the Apache 2 License.

Recommended reference sources

Documentation

What does AKKA mean?

It is the name of a beautiful Swedish mountain up in the northern part of Sweden called Laponia. The mountain is also sometimes called ‘The Queen of Laponia’.

Akka is also the name of a goddess in the Sámi (the native Swedish population) mythology. She is the goddess that stands for all the beauty and good in the world. The mountain can be seen as the symbol of this goddess.

Also, the name AKKA is a palindrome of letters A and K as in Actor Kernel.

Akka is also:

  • the name of the goose that Nils travelled across Sweden on in The Wonderful Adventures of Nils by the Swedish writer Selma Lagerlöf.
  • the Finnish word for ‘nasty elderly woman’ and the word for ‘elder sister’ in the Indian languages Tamil, Telugu, Kannada and Marathi.
  • a font
  • a town in Morocco
  • a near-earth asteroid
8162 questions
43
votes
3 answers

Discovery of Akka actors in cluster

I’ve been trying to wrap my head around the concepts of Akka and actor-based systems recently. While I have a pretty good understanding of the Akka fundamentals by now I’m still struggling with a few things when it comes to clustering and remote…
Lunikon
  • 3,751
  • 4
  • 23
  • 20
39
votes
3 answers

In Scala Akka futures, what is the difference between map and flatMap?

in normal Scala map and flatMap are different in that flatMap will return a iterable of the data flattened out into a list. However in the Akka documentation, map and flatMap seem to do something…
Phil
  • 46,436
  • 33
  • 110
  • 175
39
votes
4 answers

How to restrict actor messages to specific types?

In Akka, is there a way to restrict messages to actors to be of a specific static type other than using the "Typed Actor" APIs that use an RPC style programming model? Can I use the message passing style with Akka without throwing away static type…
mkneissl
  • 4,902
  • 2
  • 26
  • 28
39
votes
5 answers

Spray, Akka-http and Play, Which is the best bet for a new HTTP/REST project

I'm going to develop new HTTP/REST services using Scala and Akka Actors. I have experience working with Play, but I don't really need a complete web Framework. From what I read, I think Spray is a suitable choice. My question come from the future…
Fede
  • 804
  • 1
  • 10
  • 21
39
votes
2 answers

Difference between Java Concurrency, Akka and RxJava?

Today I found that, for concurrency in java we have good framework like Akka and I also found that, there is a reactive programming frameworks like RxJava for performing multithreading in application. But I'm still confused! Why are both better than…
Harmeet Singh Taara
  • 6,483
  • 20
  • 73
  • 126
38
votes
2 answers

Akka HTTP: Blocking in a future blocks the server

I am trying to use Akka HTTP to basic authenticate my request. It so happens that I have an external resource to authenticate through, so I have to make a rest call to this resource. This takes some time, and while it's processing, it seems the rest…
Kao
  • 2,242
  • 3
  • 22
  • 31
38
votes
4 answers

When to use Actors vs Futures?

I am currently working on a Play! project that has the following architecture: Controllers -> Services (actors) -> Models (Regular case classes) For each request that comes in, we will issue a call to the service layers like so: Service ?…
James Cowhen
  • 2,837
  • 3
  • 24
  • 32
38
votes
2 answers

Map the Exception of a failed Future

What's the cleanest way to map the Exception of a failed Future in scala? Say I have: import scala.concurrent._ import scala.concurrent.ExecutionContext.Implicits.global val f = Future { if(math.random < 0.5) 1 else throw new Exception("Oh no")…
theon
  • 14,170
  • 5
  • 51
  • 74
37
votes
7 answers

akka HttpResponse read body as String scala

So I have a function with this signature (akka.http.model.HttpResponse): def apply(query: Seq[(String, String)], accept: String): HttpResponse I simply get a value in a test like: val resp = TagAPI(Seq.empty[(String, String)], api.acceptHeader) I…
tg44
  • 810
  • 1
  • 8
  • 21
36
votes
1 answer

Scala actors & Ambient Reference

In Phillip Haller's PhD thesis he mentioned in section (5.1 Future Work) that one of the interesting areas of research would be to extend the framework with ambient references and he cited Van Cutsen's paper. Excerpt: The Scala Actors library…
Nabegh
  • 3,249
  • 6
  • 25
  • 26
35
votes
4 answers

How does one log Akka HTTP client requests

I need to log akka http client requests as well as their responses. While there seems to be a hint of API for logging these requests, there is no clear documentation on how it should be done. My approach has been to create a logged request which…
David Weber
  • 1,965
  • 1
  • 22
  • 32
34
votes
7 answers

Data Consistency Across Microservices

While each microservice generally will have its own data - certain entities are required to be consistent across multiple services. For such data consistency requirement in a highly distributed landscape such as microservices architecture, what are…
Santanu Dey
  • 2,900
  • 3
  • 24
  • 38
34
votes
1 answer

Comparison of Java reactive frameworks

I see many frameworks/libraries that claim that they can help build reactive applications in Java, such as: Akka, Vert.x, RxJava, Reactor, QBit, etc. They seem to have different approaches, features, pros, cons, etc. I could not find detailled…
Florian Beaufumé
  • 1,751
  • 2
  • 22
  • 34
34
votes
1 answer

How to fix the Dropping Close since the SSL connection is already closing error in spray

I’m making a call to an API, but most of the time I keep getting an error: “Dropping Close since the SSL connection is already closing” and “Premature connection close (the server doesn't appear to support request pipelining).” Like 90% of the time…
maya.js
  • 1,147
  • 12
  • 25
33
votes
3 answers

How to convert Source[ByteString, Any] to InputStream

akka-http represents a file uploaded using multipart/form-data encoding as Source[ByteString, Any]. I need to unmarshal it using Java library that expects an InputStream. How Source[ByteString, Any] can be turned into an InputStream?
kostya
  • 9,221
  • 1
  • 29
  • 36