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
8
votes
2 answers

Using dynamic sink destination in Akka Streams

I'm rather new to Akka and am trying to learn the basics. My use case is to continually read messages from a JMS queue and output each message to a new file. I have the basic setup working with: Source jmsSource = JmsSource …
Christian Morin
  • 211
  • 1
  • 12
8
votes
1 answer

How to clean up substreams in continuous Akka streams

Given I have a very long running stream of events flowing through something as show below. When a long time has passed there will be lots of sub streams created that is no longer needed. Is there a way to clean up a specific substream at a given…
user3139545
  • 6,882
  • 13
  • 44
  • 87
8
votes
2 answers

Elegant way of reusing akka-stream flows

I am looking for a way to easily reuse akka-stream flows. I treat the Flow I intend to reuse as a function, so I would like to keep its signature like: Flow[Input, Output, NotUsed] Now when I use this flow I would like to be able to 'call' this…
8
votes
1 answer

Akka Streams - How to keep materialized value of an auxiliary Sink in a Graph

I have a function returning a Flow whose logic involves passing some elements of the graph to an auxiliary Sink passed as a parameter. I want to retain the auxiliary Sink's materialized value so I'm able to act upon its value when the constructed…
Sergey
  • 2,880
  • 3
  • 19
  • 29
8
votes
1 answer

Chain Akka-http-client requests in a Stream

I would like to chain http request using akka-http-client as Stream. Each http request in a chain depends on a success/response of a previous requests and uses it to construct a new request. If a request is not successful, the Stream should return…
Rabzu
  • 52
  • 5
  • 26
8
votes
1 answer

Monitoring a closed graph Akka Stream

If I have created a RunningGraph in Akka Stream, how can I know (from the outside) when all nodes are cancelled due to completion? when all nodes have been stopped due to an error?
0__
  • 66,707
  • 21
  • 171
  • 266
8
votes
1 answer

How to assemble an Akka Streams sink from multiple file writes?

I'm trying to integrate an akka streams based flow in to my Play 2.5 app. The idea is that you can stream in a photo, then have it written to disk as the raw file, a thumbnailed version and a watermarked version. I managed to get this working using…
Tompey
  • 334
  • 2
  • 7
8
votes
1 answer

How to implement a simple TCP protocol using Akka Streams?

I took a stab at implementing a simple TCP-based protocol for exchanging messages with Akka Streams (see below). However, it seems like the incoming messages are not processed immediately; that is, in the scenario where two messages are sent one…
Andrey
  • 8,882
  • 10
  • 58
  • 82
8
votes
1 answer

ExecutionContext to use with mapAsync in Akka-Streams

I am just getting started with Akka Stream and I am trying to figure something out: Currently, in my flows I am using mapAsync() to integrate with my rest services, as recommended here. I have been wondering, what execution context should the…
Emil D
  • 1,864
  • 4
  • 23
  • 40
8
votes
1 answer

Akka HTTP: How to unmarshal Json format response into domain objects

I am trying out Akka HTTP, and I have created a service that returns a Json Array of domain objects in HttpResponse. In the client I want to convert it to a Source of domain objects so it can be consumed by the subsequent Flows and Sinks. Referring…
pumpump
  • 361
  • 2
  • 15
8
votes
2 answers

Get whole HttpResponse body as a String with Akka-Streams HTTP

I'm trying to understand how to use the new akka.http library. I would like to send an http request to a server and read the whole response body as a single String in order to produce a Source[String,?]. Here is the best solution I was able to…
paradigmatic
  • 40,153
  • 18
  • 88
  • 147
8
votes
1 answer

Live resources in Akka Stream flow description

There is this note in the akka-stream docs stating as follows: … a reusable flow description cannot be bound to “live” resources, any connection to or allocation of such resources must be deferred until materialization time. Examples of “live”…
mutantacule
  • 6,913
  • 1
  • 25
  • 39
8
votes
1 answer

Akka-http streaming using Slick 3.0 Databasepublisher

I am using slick 3.0 and have a databasepublisher object as def getAsStream = db.stream[Entity](tblquery.result) I am using akka-http for rest layer as follows, val route = path("stream"){ get { complete { // how to stream from here } …
S.Karthik
  • 1,389
  • 9
  • 21
7
votes
0 answers

Akka-http detect client connection close

I have a question. I have Akka HTTP Server and using Akka HTTP Client. The Client does a lot of external calls basically with Http.singleRequest(). This takes a lot of time and sometimes User closes the connection to my Server. So the question is…
7
votes
2 answers

Lagom service consuming input from Kafka

I am trying to figure out how Lagom can be used to consume data from external systems communicating over Kafka. I've ran into this section of Lagom documentation, which describes how Lagom service can communicate with another Lagom service by…
ioreskovic
  • 5,531
  • 5
  • 39
  • 70