Questions tagged [akka-stream]

Akka implementation for handling streaming data on the JVM

Akka implementation of reactive-streams standard for handling streaming data on the .

This library uses Akka Actor based transformations of data streams which proceed as a series of steps which can be executed in parallel, in a pipelined fashion.

More info:

1741 questions
20
votes
2 answers

How to use an Akka Streams SourceQueue with PlayFramework

I would like to use a SourceQueue to push elements dynamically into an Akka Stream source. Play controller needs a Source to be able to stream a result using the chuncked method. As Play uses its own Akka Stream Sink under the hood, I can't…
Loic
  • 3,310
  • 4
  • 25
  • 43
19
votes
3 answers

Why is Akka Streams swallowing my exceptions?

Why is the exception in import akka.actor.ActorSystem import akka.stream.ActorMaterializer import akka.stream.scaladsl.Source object TestExceptionHandling { def main(args: Array[String]): Unit = { implicit val actorSystem = ActorSystem() …
Matthias Langer
  • 994
  • 8
  • 22
19
votes
1 answer

Difference between map and mapAsync

Can anyone please explain me difference between map and mapAsync w.r.t AKKA stream? In the documentation it is said that Stream transformations and side effects involving external non-stream based services can be performed with mapAsync or…
Anand
  • 601
  • 2
  • 7
  • 17
16
votes
1 answer

Proper way to stop Akka Streams on condition

I have been successfully using FileIO to stream the contents of a file, compute some transformations for each line and aggregate/reduce the results. Now I have a pretty specific use case, where I would like to stop the stream when a condition is…
jarandaf
  • 4,297
  • 6
  • 38
  • 67
15
votes
2 answers

Transforming Slick Streaming data and sending Chunked Response using Akka Http

The aim is to stream data from a database, perform some computation on this chunk of data(this computation returns a Future of some case class) and send this data as chunked response to the user. Currently I am able to stream data and send the…
user3294786
  • 177
  • 2
  • 10
15
votes
4 answers

Reading a CSV files using Akka Streams

I'm reading a csv file. I am using Akka Streams to do this so that I can create a graph of actions to perform on each line. I've got the following toy example up and running. def main(args: Array[String]): Unit = { implicit val system =…
user3248346
15
votes
1 answer

How to properly call Akka HTTP client for multiple (10k - 100k) requests?

I'm trying to write a tool for batch data upload using Akka HTTP 2.0-M2. But I'm facing akka.stream.OverflowStrategy$Fail$BufferOverflowException: Exceeded configured max-open-requests value of [32] error. I tried to isolate a problem and here is…
relgames
  • 1,356
  • 1
  • 16
  • 34
14
votes
2 answers

Dynamically creating Akka Stream Flows at Runtime

I'm currently trying to dynamically create Akka Stream graph definitions at runtime. The idea being that users will be able to define flows interactively and attach them to existing/running BroadcastHubs. This means I don't know which flows or even…
14
votes
3 answers

How to read query parameters in akka-http?

I know akka-http libraries marshal and unmarshal to class type while processing request.But now, I need to read request-parameters of GET request. I tried parameter() method and It is returning ParamDefAux type but i need those values as strings…
Siva Kumar
  • 632
  • 3
  • 9
  • 19
14
votes
2 answers

Conditionally skip flow using akka streams

I'm using akka streams and I have a segment of my graph that I need to conditionally skip because the flow can't handle certain values. Specifically, I have a flow that takes a string and makes http requests, but the server can't handle the case…
Falmarri
  • 47,727
  • 41
  • 151
  • 191
13
votes
1 answer

Gracefully restart a Reactive-Kafka Consumer Stream on failure

Problem When I restart/complete/STOP stream the old Consumer does not Die/Shutdown: [INFO ] a.a.RepointableActorRef - Message [akka.kafka.KafkaConsumerActor$Internal$Stop$] from Actor[akka://ufo-sightings/deadLetters] to…
Rabzu
  • 52
  • 5
  • 26
13
votes
1 answer

Should I share the Materializer instance or always create a new one when needed?

I'm currently working on a project that extensively uses Akka and Akka Streams. One question/problem keeps coming up while working with it: What is the best practice for the Materializer which is needed in all places where streams are used.…
Alexander Block
  • 2,025
  • 1
  • 10
  • 11
13
votes
5 answers

Split Akka Stream Source into two

I have an Akka Streams Source which I want to split into two sources according to a predicate. E.g. having a source (types are simplified intentionally): val source: Source[Either[Throwable, String], NotUsed] = ??? And two methods: def…
Tvaroh
  • 6,645
  • 4
  • 51
  • 55
13
votes
2 answers

File upload using Akka HTTP

I am trying to implement file upload functionality in my application using Akka HTTP. I am using akka-stream version 2.4.4. Here is the code (modified from akka-doc) path("fileupload") { post { extractRequestContext { ctx => { …
Yadu Krishnan
  • 3,492
  • 5
  • 41
  • 80
13
votes
2 answers

How do I supply an implicit value for an akka.stream.Materializer when sending a FakeRequest?

I'm trying to make sense of the error(s) I'm seeing below, and to learn how to fix it. could not find implicit value for parameter materializer: akka.Stream.Materializer val fut: Future[Result] = action.apply(fakeRequest).run …
gknauth
  • 2,310
  • 2
  • 29
  • 44