[akka-user][deprecated] Re: [akka-user] Akka Stream buffer size monitoring

2020-04-11 Thread Andreas H. Presthammer
Did anything ever happen to this. Was there ever made a mechanism for monitoring a buffer? On Sunday, January 15, 2017 at 8:20:06 PM UTC+1, Konrad Malawski wrote: > > That's something we'll work on at Lightbend in 2017, it's be part of > Lightbend/Reactive Monitoring. > As far as I can tell

Re: [akka-user] Akka stream out of band data

2018-02-18 Thread Christopher Hunt
Hey Roland > On 18 Feb 2018, at 22:45, 'Roland Kuhn' via Akka User List > wrote: > > Yes, we considered it with varying depth on multiple occasions and never > found a satisfactory solution. Since graph stages are free to transform not > only individual elements

Re: [akka-user] Akka stream out of band data

2018-02-18 Thread 'Roland Kuhn' via Akka User List
Sent from my iPhone > On 18. Feb 2018, at 11:53, Christopher Hunt wrote: > > > >> On 18 Feb 2018, at 21:10, Viktor Klang wrote: >> >> How do you deal with M:N ports or X:Y element permutations? > > No idea. :-) My main question is, has there

Re: [akka-user] Akka stream out of band data

2018-02-18 Thread Christopher Hunt
> On 18 Feb 2018, at 21:10, Viktor Klang wrote: > > How do you deal with M:N ports or X:Y element permutations? No idea. :-) My main question is, has there been any thinking around associating metadata with elements in the past? Thanks. Cheers C -- >>

Re: [akka-user] Akka stream out of band data

2018-02-18 Thread Viktor Klang
How do you deal with M:N ports or X:Y element permutations? -- Cheers, √ On Feb 18, 2018 01:53, "Christopher Hunt" wrote: > Hi there, > > I’ve been wondering recently if there’s been any thought around carrying > out of band data through an Akka Stream in the spirit of

Re: [akka-user] Akka stream element meta data

2018-02-18 Thread Christopher Hunt
> On 18 Feb 2018, at 3:18 pm, Christopher Hunt wrote: > > It just occurred to me that compound types might be the way to solve this eg > `new Element with OOB[Span]`. I shall experiment further... and then PR the > Akka stream doco with a section on OOB/instrumentation if

Re: [akka-user] Akka stream out of band data

2018-02-17 Thread Christopher Hunt
> On 18 Feb 2018, at 11:53, Christopher Hunt wrote: > > By way of solution, perhaps this could be achieved similarly to the > materialiser api calls eg viaMat/viaOob. It just occurred to me that compound types might be the way to solve this eg `new Element with

[akka-user] Akka stream out of band data

2018-02-17 Thread Christopher Hunt
Hi there, I’ve been wondering recently if there’s been any thought around carrying out of band data through an Akka Stream in the spirit of network streams: https://en.m.wikipedia.org/wiki/Out-of-band_data One use case is for carrying Open Tracing Spans with elements without polluting stream

Re: [akka-user] Akka stream - Framing with multiple delimiters

2017-11-11 Thread Patrik Nordwall
When thinking more about it I realize that a function ByteString => Boolean will probably not work well in the general case where the delimiter is more than one byte. Probably has be a fixed set of delimiters. /Patrik On Sat, Nov 11, 2017 at 3:27 PM, regis leray wrote: >

Re: [akka-user] Akka stream - Framing with multiple delimiters

2017-11-11 Thread regis leray
Oki, i will create a pull request to provide a function, good idea ! Le samedi 11 novembre 2017 03:35:28 UTC-5, Patrik Nordwall a écrit : > > You could do that by first replacing the various delimiters with one > common, in a map stage. That said, if this is typical framing requirement > we

Re: [akka-user] Akka stream - Framing with multiple delimiters

2017-11-11 Thread Patrik Nordwall
You could do that by first replacing the various delimiters with one common, in a map stage. That said, if this is typical framing requirement we could perhaps add more power to the framing stage, e.g. a funtion ByteString => Boolean. That would be a good community contribution. /Patrik lör 11

[akka-user] Akka stream - Framing with multiple delimiters

2017-11-10 Thread regis leray
Hi, Currently the implementation Framing.delimiter(ByteString("."), Int.MaxValue) only accept one delimiter. I would like to be able to use many delimiters . , ; to be able to parse such string Lorem Ipsum is simply,Dummy text of the printing;And typesetting industry. thanks --

Re: [akka-user] Akka Stream Tcp Messaging Server POC

2017-11-02 Thread Akka Team
What is happening when you run the code and how is that different from what you expect? -- Johan Akka Team On Mon, Aug 7, 2017 at 2:16 PM, G J wrote: > I'm new Akka stream, I have to build on poc on Akka stream for instant > messaging. So I need a help to understand what

Re: [akka-user] Akka Stream - Framing silently swallows exceptions?

2017-09-25 Thread Fabio Tiriticco
I apologise if my last line came out sarcastic. It absolutely wasn't meant to be - my respect for Lightbend's work is second to no-one else's. Concerning the issue, I had messed things up and therefore my confused message. The link doesn't work as I had deleted the post on Stackoverflow, and

Re: [akka-user] Akka Stream - Framing silently swallows exceptions?

2017-09-25 Thread Konrad “ktoso” Malawski
On 26 September 2017 at 10:47:44, Fabio Tiriticco (fabio.eur...@gmail.com) wrote: Hi all, I noticed that the Framing flow of Akka Streams tends to stop the stream without letting the outer world know. In essence, the stream just stops and supervision is not triggered. It propagates errors

[akka-user] Akka Stream - Framing silently swallows exceptions?

2017-09-25 Thread Fabio Tiriticco
Hi all, I noticed that the Framing flow of Akka Streams tends to stop the stream without letting the outer world know. In essence, the stream just stops and supervision is not triggered. The details of my findings are here:

Re: [akka-user] akka stream design for processing CPU+RAM intensive operations

2017-09-19 Thread Jakub Liska
On Tuesday, September 19, 2017 at 9:53:36 PM UTC+2, Patrik Nordwall wrote: > > You can try and compare Balance, Partition and PartitionHub. > Is the fundamental difference between GroupBy and Partition/PartitionHub the fact that the latter gives you more fine-grain control over the internal

Re: [akka-user] akka stream design for processing CPU+RAM intensive operations

2017-09-19 Thread Patrik Nordwall
You can try and compare Balance, Partition and PartitionHub. /Patrik > On Sep 19, 2017, at 00:16, Jakub Liska wrote: > > Hey, > > having an operation that heavily utilizes CPU and RAM, nothing else (no IO), > but it is a main bottleneck, then it never pays off using

[akka-user] akka stream design for processing CPU+RAM intensive operations

2017-09-18 Thread Jakub Liska
Hey, having an operation that heavily utilizes CPU and RAM, nothing else (no IO), but it is a main bottleneck, then it never pays off using `stream.mapAsync` for it unless you batch operations by something like 10 000, so I started using stuff like : .map(operation).withAttributes(

[akka-user] Akka Stream Kafka - Avro Desereilization

2017-09-15 Thread Yaser Arshad
Hi, Using Kafka Source in Akka Streams Kafka, I am trying to deserialize an Avro object using KafkaAvroDeserializer that is created using avro-tools library. If I use confluent Kafka Consumer, I can deserialize it like this: def consumerProperties() = { val props = new Properties

[akka-user] Akka Stream getting Termination message just after sucuss message when my neety client connected.

2017-08-18 Thread G J
I'm getting termination message just after sucuss message when my neety client connected. I'm new in akka stream. Please help me what i'm missing in my poc. import java.net.InetSocketAddress; import java.util.concurrent.CompletionStage; import akka.Done; import akka.actor.ActorRef; import

Re: [akka-user] [akka-stream] How to provide flow with 'last seen element' backup?

2017-08-10 Thread Akka Team
I misread it as wanting the last value to pass through the stream before completion, but I guess it was, read the last value that passed by in a stream. There's no stage that does that out of the box, so providing your own safe concurrent field of some kind, or firing of the elements to an actor

Re: [akka-user] [akka-stream] How to provide flow with 'last seen element' backup?

2017-08-07 Thread Alexey Shuksto
Hi, Johan, Thanks for your reply, but would not `Sink.last` complete it's Future only after Source fully completed? I need to check for last passed value in-between: ``` val bh = Source.unfold(0)(v => Some((v+1, v))).delay(1.minute).runWith(BroadcastHub.sink) bh.runWith(Sink.ignore) ``` So,

Re: [akka-user] [akka-stream] How to provide flow with 'last seen element' backup?

2017-08-07 Thread Akka Team
You can achieve this by using Sink.last which will materialize into a Future[T] that completes with the last element emitted. It does however not complete the promise with the last element on failures, this can be remedied by prepending it with a .recoverWithRetries(0, { case _ => Source.empty

[akka-user] Akka Stream Messaging Server Poc

2017-08-07 Thread G J
I'm getting termination message just after sucuss message when my neety client connected. I'm new in akka stream. Please help me what i'm missing in my poc. import java.net.InetSocketAddress; import java.util.concurrent.CompletionStage; import akka.Done; import akka.actor.ActorRef; import

[akka-user] Akka Stream Tcp Messaging Server POC

2017-08-07 Thread G J
I'm new Akka stream, I have to build on poc on Akka stream for instant messaging. So I need a help to understand what I'm missing here. import java.net.InetSocketAddress; import java.util.concurrent.CompletionStage; import akka.Done; import akka.actor.ActorRef; import akka.actor.Props; import

[akka-user] [akka-stream] How to provide flow with 'last seen element' backup?

2017-07-29 Thread Alexey Shuksto
Hello hAkkers, In our project we use some number of flows that follow same building logic: ``` val input: Source[T, NotUsed] = ??? val output = input.runWith(BroadcastHub.sink) output.runWith(Sink.ignore) ``` Sink.ignore here used to prevent BroadcastHub inner buffer overflow and, also, to

Re: [akka-user] Akka stream - Source of http response.

2017-05-26 Thread Konrad Malawski
Hi Alejandro, I don't get the question - could you rephrase it a bit (more details)? An HttpRequest simply contains a Source[ByteString, _] and that "just works"™. -- Konrad `ktoso` Malawski Akka @ Lightbend On 26 May 2017 at 00:21:38, Alejandro Merchan

[akka-user] Akka stream - Source of http response.

2017-05-25 Thread Alejandro Merchan
Hi everybody. One question, how is possible create a continuous Source from http client response? thanks !! -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html >> Search the

Re: [akka-user] akka stream kafka newbie question

2017-05-01 Thread Shannon Ma
After i cleaned up my maven repository, it is working now, though i did not narrow down to which lib/jar has the conflict. Thanks Shannon -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html

Re: [akka-user] akka stream kafka newbie question

2017-04-28 Thread Shannon Ma
Thanks, thats what i have com.typesafe.akka akka-stream-kafka_2.12 0.15 and i can see i only have actor 2.12 (which is 2.4.17) Thanks Shannon On Friday, April 28, 2017 at 10:07:55 AM UTC-5, Akka Team wrote: > > You should combine the same versions of Scala. If you use >

Re: [akka-user] akka stream kafka newbie question

2017-04-28 Thread Akka Team
You should combine the same versions of Scala. If you use akka-stream-kafka_2.12 then the Akka version you use (and all other libraries written in Scala you use in fact) must have the same version of Scala since the major versions of Scala (2.11, 2.12) are not binary compatible. In addition to

Re: [akka-user] akka stream kafka newbie question

2017-04-28 Thread Shannon Ma
With 2.12, i had to update the code, return new ProducerMessage.Message( new ProducerRecord("akkatest", msg.record().key(), msg.record().value()), msg.committableOffset()); but getting Exception in

Re: [akka-user] akka stream kafka newbie question

2017-04-28 Thread Shannon Ma
My Kafka version : 0.10.1.1, i should use akka-stream-kafka_2.12, right? -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html >> Search the archives:

Re: [akka-user] akka stream kafka newbie question

2017-04-28 Thread Shannon Ma
Looks like it is the message type, from another example when i do this, it passes compilation. s.map(new Function, ProducerMessage.Message>() { public

Re: [akka-user] akka stream kafka newbie question

2017-04-28 Thread Shannon Ma
Here is my code final ActorSystem system = ActorSystem.create(); ActorMaterializer materializer = ActorMaterializer.create(system); final ConsumerSettings consumerSettings = ConsumerSettings.create(system, new SpecificAvroDeserializer(), new

Re: [akka-user] akka stream kafka newbie question

2017-04-28 Thread Shannon Ma
Thanks, yes i am putting the materializer, runWith(Producer.commitableSink(producerSettings), materializer); Is this a java and/or scala version issue? i am using com.typesafe.akka akka-stream-kafka_2.11 0.11-RC2 and scala library 2.11.4 On Thursday, April 27, 2017 at 8:52:03 PM

Re: [akka-user] akka stream kafka newbie question

2017-04-27 Thread Konrad Malawski
A Sink is a Graph; as is a Flow, and a Source - they're all graphs, of a specific shape. Here, the method takes a Graph

[akka-user] akka stream kafka newbie question

2017-04-27 Thread Shannon Ma
Hi, I am new to akka stream kafka, and am trying to follow some the examples to get start. I try to use Source.runWith(Sink.ignore()) or Soruce.runWith(Producer.commitableSink(producerSettings) and get this compilation error The method

Re: [akka-user] Akka Stream- How to use Slick as Subscriber(Sink) to data into Database.

2017-03-28 Thread Konrad Malawski
AFAIR they have not implemented streaming inserts. Just data.mapAsync()(insert). -- Konrad `ktoso` Malawski Akka @ Lightbend On 28 March 2017 at 10:19:50, DEEPAK GUPTA (vnitdee...@gmail.com) wrote: Akka Stream- How to use Slick as Subscriber(Sink) to

[akka-user] Akka Stream- How to use Slick as Subscriber(Sink) to data into Database.

2017-03-28 Thread DEEPAK GUPTA
Akka Stream- How to use Slick as Subscriber(Sink) to data into Database. Example will help a lot -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html >> Search the archives:

[akka-user] [akka-stream] MergeHub slows consumption when Source with 'delay' is merged to it -- bug?

2017-03-27 Thread Alexey Shuksto
Hello hAkkers, I've got so very weird situation when 'MergeHub.source' with merged in it 'Source.repeat(..).delay(..)' slowly decreases consumption rate of materialized Sinks. Some simple synthetic test follows: import java.time.Instant import akka.actor.ActorSystem import

[akka-user] Akka Stream with ActorPublisher Integration Serialization Issue

2017-02-17 Thread T Z
Hi, Does anyone have any idea on the cause of this error? I am integrating an ActorPublisher into my streaming/chunk source response back to the client but this exception is thrown. It looks to be an auto-generated message within Akka Pub-Sub. Any help is greatly appreciated! 2017-02-17

Re: [akka-user] [Akka stream] Sink/source materialization

2017-02-09 Thread hbf
On Wednesday, February 8, 2017 at 12:25:25 AM UTC-8, √ wrote: > > You mean like: Source.single(()).flatMapConcat(_ => yourFunction())? > Cool, that works. I also see Source.unfoldResource, which I missed before and seems super useful. I was more struggling with the sink-side: is there a

Re: [akka-user] [Akka stream] Sink/source materialization

2017-02-08 Thread Viktor Klang
You mean like: Source.single(()).flatMapConcat(_ => yourFunction())? -- Cheers, √ On Feb 8, 2017 03:33, "hbf" wrote: > Heya everybody! > > I know that Akka Stream elegantly distinguishes *describing* a graph from > *materializing* a graph. > > When working on custom Akka Stream

[akka-user] [Akka stream] Sink/source materialization

2017-02-07 Thread hbf
Heya everybody! I know that Akka Stream elegantly distinguishes *describing* a graph from *materializing* a graph. When working on custom Akka Stream sink/sources, I often find myself looking for a simple way to create a source (or sink) from a function that gets called at materialization

Re: [akka-user] [Akka Stream] Happens-before relation and runForEach

2017-02-07 Thread hbf
Thanks, Roland and √. My example was indeed made up (there are better constructs in place) but thanks for clarifying that it's indeed the JVM happens-before relations that applies. – Kaspar On Wednesday, September 21, 2016 at 12:56:41 AM UTC-7, √ wrote: > > Technically I think the solution

Re: [akka-user] Akka Stream buffer size monitoring

2017-01-15 Thread Konrad Malawski
That's something we'll work on at Lightbend in 2017, it's be part of Lightbend/Reactive Monitoring. As far as I can tell none of the other monitoring tools nowadays can handle such things (neither for akka or any other reactive-streams impl), we'll get there rather soon I hope since the underlying

[akka-user] Akka Stream buffer size monitoring

2017-01-15 Thread hbf
Hey Akka Stream'ers, I'm trying to monitor the current size of the buffer of a Akka Stream buffer() stage to something like Grafana. Is there a way to hook a call to my metrics framework into the buffer? I was hoping for a second parameter to buffer, maybe flow.buffer(1000, size =>

Re: [akka-user] Akka stream never completes

2016-12-27 Thread Sergey Sopin
Yep, thanks a lot! I completely forgot about it. вторник, 27 декабря 2016 г., 19:53:45 UTC+2 пользователь √ написал: > > eagerClose on the Merge? > > -- > Cheers, > √ > > On Dec 27, 2016 6:30 PM, "Sergey Sopin" > wrote: > >> Hi all, >> >> >> I am trying to build a flow,

Re: [akka-user] Akka stream never completes

2016-12-27 Thread Viktor Klang
eagerClose on the Merge? -- Cheers, √ On Dec 27, 2016 6:30 PM, "Sergey Sopin" wrote: > Hi all, > > > I am trying to build a flow, which will return CompletionStage with the > List inside. It looks like following: > > > private CompletionStage

[akka-user] Akka stream never completes

2016-12-27 Thread Sergey Sopin
Hi all, I am trying to build a flow, which will return CompletionStage with the List inside. It looks like following: private CompletionStage buildAndRunGraph(ArrayList sourceList) { Source source = Source.from(sourceList); Materializer materializer =

[akka-user] Akka Stream WebSocket connection ActorRef

2016-12-14 Thread Владимир Морозов
Hi all, I try to use materialized value, in my case builder.materializedValue contains ActorRef that hold websocket connection. I don’t want to send it to my userActor. How I can solve that problem? Flow.fromGraph(GraphDSL.create(connectionActorSource) { implicit builder =>

Re: [akka-user] Akka Stream stalling with JsonFraming

2016-12-07 Thread Konrad Malawski
Excellent, thanks! -- Konrad `ktoso` Malawski Akka @ Lightbend On 7 December 2016 at 05:53:10, subo...@gmail.com (subo...@gmail.com) wrote: I figured it out. Submitting a pull request! On Tuesday, December 6, 2016 at 12:29:28 PM UTC-7, Konrad Malawski

Re: [akka-user] Akka Stream stalling with JsonFraming

2016-12-06 Thread subopt1
I figured it out. Submitting a pull request! On Tuesday, December 6, 2016 at 12:29:28 PM UTC-7, Konrad Malawski wrote: > > Is the JSON well formed and "normal" or something weird or maybe huge > objects or something in there etc? > Try to debug at which point it gets stuck. > > A minimized

Re: [akka-user] Akka Stream stalling with JsonFraming

2016-12-06 Thread Konrad Malawski
Is the JSON well formed and "normal" or something weird or maybe huge objects or something in there etc? Try to debug at which point it gets stuck. A minimized reproducer would help. -- Konrad `ktoso` Malawski Akka @ Lightbend On 6 December 2016 at

[akka-user] Akka Stream stalling with JsonFraming

2016-12-06 Thread subopt1
I working on a Akka Streams project that reads gzipped files from S3 and parses json. The issue I'm running into the stream stalls at about 24523530 bytes and then times-out after a 1 minute (java.util.concurrent.TimeoutException: No elements passed in the last 1 minute), but there is no error

[akka-user] Akka-stream - aggregate record counts while writing to a sink, and update an object in the middle of the flow process with the aggregated data.

2016-11-03 Thread Eugene Dzhurinsky
Hello, I want to implement the following workflow: - a source has the sequence of IDs to process - initial flow *INIT* fetches the document by ID and extracts the *profile* - another flow *FETCH* is spawned, it fetches one or more of the associated documents and store them in some sink *DATA

Re: [akka-user] Akka-stream - source is not processed asynchronously?

2016-11-01 Thread Patrik Nordwall
That sounds strange. I think the code looks good. Just to clarify, it's extractUserList that you expect to be performed in parallel? /Patrik On Mon, Oct 31, 2016 at 2:16 AM, Eugene Dzhurinsky wrote: > I want to fetch and process multiple resources using streams. I have a >

[akka-user] Akka-stream - source is not processed asynchronously?

2016-10-30 Thread Eugene Dzhurinsky
I want to fetch and process multiple resources using streams. I have a list of user ids and I am traversing the list by mapping the ID to an iterator of other links. So far it works pretty well, however can see that despite of usage of *mapAsyncUnordered* - the stream source is processed

[akka-user] [akka-stream] Detect failure in MergeHub

2016-10-18 Thread Victor
Hi, It's written in the ScalaDoc of the *MergeHub.source* method that: If one of the inputs fails the Sink, the Source is failed in turn But, in the MergeHub source code, the *onUpstreamFailure* method only throw an exception: override def onUpstreamFailure(ex: Throwable): Unit = { throw

[akka-user] [akka-stream] Problems with the shape creation

2016-10-17 Thread Sergey Sopin
Hi, I am trying to create my own akka streams shape with several Inlets and Outlets. I have written following code: package kernel.modeller.workers.streamFinder.generic import akka.stream.{Shape, Outlet, Inlet} import scala.annotation.unchecked.uncheckedVariance import

Re: [akka-user] Akka stream - implements Pause/Resume

2016-10-14 Thread regis leray
Thanks a lot for your informations (and sorry for the double post). Can you please tell me what is the way to "wake up the stage", it is not really obvious how to make that happen. Thanks Le vendredi 14 octobre 2016 04:09:12 UTC-4, Konrad Malawski a écrit : > > Please read this: > -

Re: [akka-user] Akka stream - implements Pause/Resume

2016-10-14 Thread Konrad Malawski
Please read this: - http://blog.akka.io/integrations/2016/08/29/connecting-existing-apis - and this: http://doc.akka.io/docs/akka/2.4/scala/stream/stream-customize.html Specifically, your trigger should be implemented as async-callback, as it comes from the outside but should "wake up" the stage

[akka-user] Akka stream - implements Pause/Resume

2016-10-14 Thread regis leray
Hi, Im currently trying to implement a valve Graph to manage pause/resume. We can control the behavior of the graph by using the MaterializeValue trait ValveSwitch { def open: Unit def close: Unit } Current implementation of the valve class Valve[A](mode: ValveMode = ValveMode.Open)

[akka-user] Akka stream - Flow in Pause

2016-10-13 Thread regis leray
Hi, I'm trying to implements a way to control a flow (start/stop), nothing was implemented yet in the core of akka-stream My current implementation looks like this. trait ValveSwitch { def open: Unit def close: Unit } class Valve[A](mode: ValveMode = ValveMode.Open) extends

[akka-user] akka-stream-scala template dependency not found by Lightbend Activator, so compile fails

2016-09-30 Thread Egor Kraev
Hi, I downloaded Lightbend Activator from here http://akka.io/downloads/ and tried to load the template akka-stream-scala as indicated here http://www.lightbend.com/activator/template/akka-stream-scala. When I try to compile that inside Activator, I get - [error] (*:update)

[akka-user] [akka-stream] How to implement Spark's cogroup/join operation

2016-09-27 Thread Jakub Liska
Hey, I'm reimplementing a few Spark batch jobs as akka streams. I got stuck at the last one that takes two PairRdd[Key,Value] and cogroups them by Key which returns an Rdd[Key,Seq[Value]] and then it processes Seq[Value] for each of the unique Keys that are present in both original PairRdds,

Re: [akka-user] [Akka Stream] Happens-before relation and runForEach

2016-09-21 Thread Viktor Klang
Technically I think the solution holds water, there are appropriate barriers in place. (multi-materialization aside) However, as mentioned, fold() would be a much cleaner, safer and maintainable solution. -- Cheers, √ On Sep 21, 2016 07:05, "Roland Kuhn" wrote: >

Re: [akka-user] [Akka Stream] Happens-before relation and runForEach

2016-09-20 Thread Roland Kuhn
Technically I'm not sure this is correct: since f is only called from within a single operator (and assuming only a single materialization) the shown code should work just fine. Of course it is necessary to know what you're doing when coding like this, and as Konrad says there are better

Re: [akka-user] [Akka Stream] Happens-before relation and runForEach

2016-09-20 Thread hbf
Thanks for clarifying, Konrad. – Hbf On Tuesday, September 20, 2016 at 4:33:53 PM UTC-7, Konrad Malawski wrote: > > > final Source source = // ... > final MutableInt max = new MutableInt(Integer.MIN_VALUE); > final Procedure f = i -> { > if (i >

Re: [akka-user] [Akka Stream] Happens-before relation and runForEach

2016-09-20 Thread Konrad Malawski
final Source source = // ... final MutableInt max = new MutableInt(Integer.MIN_VALUE); final Procedure f = i -> { if (i > max.intValue()) { max.setValue(i); } }; final CompletionStage result = source .runForeach(f, materializer)

[akka-user] [Akka Stream] Happens-before relation and runForEach

2016-09-20 Thread hbf
Hey everybody, Akka Stream may execute the function given to Source.runForEach() from different threads. Therefore, if this function has state, it may need some synchronization. For example: final Source source = // ... final MutableInt max = new

Re: [akka-user] [akka-stream] Multi input/output flow

2016-08-25 Thread Konrad Malawski
Just replace the /scala/ in the url to /java/ :-) So it becomes: http://doc.akka.io/docs/akka/2.4.9/java/stream/stream-graphs.html All Akka APIs have 100% coverage in both languages / DSLs. The Java / Scala API for GraphStage is exactly the same class btw, so you can read any blogs etc about it

Re: [akka-user] [akka-stream] Multi input/output flow

2016-08-25 Thread Sergey Sopin
Thanks a lot! It is exactly what I need, but can I do the same in Java? Regards, Sergey четверг, 25 августа 2016 г., 21:16:44 UTC+3 пользователь Konrad Malawski написал: > > If it has more than 1 input and 1 output it's not a Flow anymore, so let's > not refer to it as a Flow. > It's a Graph

Re: [akka-user] [akka-stream] Multi input/output flow

2016-08-25 Thread Konrad Malawski
If it has more than 1 input and 1 output it's not a Flow anymore, so let's not refer to it as a Flow. It's a Graph of a given Shape. There's nothing special about Shape, so if you want a custom one, you simply extend Shape, as is documented in the reference docs:

Re: [akka-user] [akka-stream] Multi input/output flow

2016-08-25 Thread Sergey Sopin
Thanks a lot for your response. However it is still not clear. I am talking about FlowShape with several Inlets and Outlets. As I understood from: http://doc.akka.io/docs/akka/2.4/java/stream/stream-customize.html#Custom_linear_processing_stages_using_GraphStage I have to create Shape by

Re: [akka-user] [akka-stream] Multi input/output flow

2016-08-25 Thread Konrad Malawski
Handlers have no shape. The GraphStage does. So your stage has some shape. And then you set as many handlers as you need. Still simple sources and sinks, but we just published a blog post explaining it a bit more: http://blog.akka.io/integrations/2016/08/25/simple-sink-source-with-graphstage

[akka-user] [akka-stream] Multi input/output flow

2016-08-25 Thread Sergey Sopin
Hi, I am trying to create multi input/output flow. It should obtain messages from different Inlets and emit to different Outlets based on parameter inside the message. Something like following: 1. ... A elem = grab(in1); 2.if (p.test(elem)) { 3.

Re: [akka-user] Akka Stream Getting Stuck (2.4.9-RC2)

2016-08-10 Thread Endre Varga
Hi, On Wed, Aug 10, 2016 at 10:26 PM, tigerfoot wrote: > For whoever finds this thread and struggles with the same problem... I've > found a solution that fixed it for me. > > implicit val materializer = ActorMaterializer( > ActorMaterializerSettings(system) >

Re: [akka-user] Akka Stream Getting Stuck (2.4.9-RC2)

2016-08-10 Thread tigerfoot
For whoever finds this thread and struggles with the same problem... I've found a solution that fixed it for me. implicit val materializer = ActorMaterializer( ActorMaterializerSettings(system) .withAutoFusing(false) // flows with LateKafka get messed up if this is true! )

Re: [akka-user] Akka Stream Getting Stuck (2.4.9-RC2)

2016-08-06 Thread tigerfoot
Hi guys, Yeah, I knew the first thing ya'll would need is a reproducer, but sadly its wired into a lot of heavy complexity, and... I can't even reproduce it consistently. It sometimes fails. I haven't (consciously) set auto-fusing or fuzzing--it's whatever the defaults are out-of-the-box.

Re: [akka-user] Akka Stream Getting Stuck (2.4.9-RC2)

2016-08-06 Thread Endre Varga
Hi Greg, On Sat, Aug 6, 2016 at 1:11 AM, tigerfoot wrote: > I'm having a nasty issue I hope someone can help me with. > > I have some stream code like this: > > val contentAssembly = Flow[CRec].map { crec => > println("HERE!") > val x =

[akka-user] Akka Stream Getting Stuck (2.4.9-RC2)

2016-08-05 Thread tigerfoot
I'm having a nasty issue I hope someone can help me with. I have some stream code like this: val contentAssembly = Flow[CRec].map { crec => println("HERE!") val x = expression.render(crec.value).asInstanceOf[Message[OutputWrapper]] println("X is "+x) (crec,

Re: [akka-user] [akka-stream] How to emit the newest element every n seconds?

2016-08-05 Thread Martynas Mickevičius
Hi. You were quite close. Instead of buffer.drophead use conflate which is a rate detached operation. That allows upstream before conflate progress faster than downstream after the conflate. Source .unfold(0) { e => Some((e + 1, e)) } .conflate[Int] { case (_, e) => e } .throttle(1,

Re: [akka-user] Akka Stream

2016-08-04 Thread Konrad Malawski
That's correct - streams are fully typed and we're pretty proud of that :) One difference I'd like to highlight though is that Streams don't directly "replace" Actors. In many cases they do, for local processing pipelines etc. However Streams (any reactive streams implementation in fact) don't

Re: [akka-user] Akka Stream

2016-08-04 Thread Mike Khan
Thanks Konrad. I'm looking into using Akka Streams because (correct me if I am wrong) I can achieve a higher level of type safety than using Akka Actors directly. The receive method of an Actor can pretty much take any type which I find worrying. Having looked into Akka Streams I realized that

Re: [akka-user] Akka Stream

2016-08-04 Thread Konrad Malawski
Yes, this is the right place. Announcements are here, as well as general community discussions. For news only you may want to subscribe to: akka.io/news And for blogs from the core team there's akka.io/blog -- Konrad `ktoso` Malawski Akka @ Lightbend On

[akka-user] Akka Stream

2016-08-04 Thread Mike Khan
Hi Is this the correct channel to stay up to date with Akka Streams? I would like to keep up to date on the direction and latest changes to the library. Mike -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ: >>

[akka-user] [akka-stream] How to emit the newest element every n seconds?

2016-07-29 Thread Dominykas Mostauskis
In Akka Stream, I'd like a stream with a timer that emits an element every n seconds. The timer should emit from a 1 element buffer that drops head on overflow (meaning only keeps the newest element). So essentially emit the newest element in intervals of n seconds. How can this be done? My

Re: [akka-user] Akka-Stream: deploying graphs from a plain config file

2016-07-11 Thread Viktor Klang
Seems tractable to define a conventional format using the condig lib and interpret the config to generate the graph. Report back if you decide to do that! -- Cheers, √ On Jul 11, 2016 17:35, "Héctor Veiga" wrote: > Hi, > > I am trying to figure out if there is any way of

[akka-user] Akka-Stream: deploying graphs from a plain config file

2016-07-11 Thread Héctor Veiga
Hi, I am trying to figure out if there is any way of deploying graphs from a plain config file. I would like to be able to define a graph using the powerful GraphDSL but instead of in Scala code, in some kind of config file. Then if you deploy that file into some folder, the stream will be

[akka-user] [akka-stream] Concatenate multiple Sources while preserving materialized values

2016-06-23 Thread Arron Norwell
Hi, I'm looking for a good way to concatenate sources while preserving materialized values. For example, If I have val source1: Source[T,Mat] = _ val source2: Source[T,akka.NotUsed] = _ I would like to be able to preserve the first materialized value (and possibly more generally, support other

[akka-user] Akka Stream CookBook - problem on trigerring a message

2016-05-26 Thread JP
Hi all, In my below sample code my Subscriber has to be triggered by a message when Publisher sends Trigger. But am not getting any response in subscriber side. I am following below links for reference:

[akka-user] Akka Stream, Framing with GraphStage instead of PushPullStage: messages get lost

2016-05-12 Thread Qux
1. Hi, I have a Problem with Framing. I tried to build the ping-pong-example from http://doc.akka.io/docs/akka/2.4.4/java/stream/stream-graphs.html. If I run it over TCP, Messages get lost: trait Message > case class Ping(id: Int) extends Message > case class Pong(id: Int) extends

[akka-user] [Akka-stream|http] - How to close a flow with killswitch from outside?

2016-05-04 Thread Magnus Andersson
I don't understand how you are to detect this behavior. You have a throttle for 1mgs/sec and a buffer of 1000mgs and a overflow strategy to drop messages. The messages will keep coming if you don't fill up the buffer, up to 1000 seconds after upstream has stopped sending messages. Is this

[akka-user] [Akka-stream|http] - How to close a flow with killswitch from outside?

2016-05-01 Thread Hamidreza Davoodi
Hi there, I've been trying to write a chatroom or actually poke around others' code so I finally (kinda) got the idea behind the streams (thanks to documentations and the tests specs) but I encountered an issue: When a websocket streams gets closed, because of the regulator(throttling by

[akka-user] [akka-stream] Stream item error propogation and akka-http

2016-04-19 Thread Arron Norwell
Hi, I am trying to use akka-http's host-level client-side Http().cachedHostConnectionPool flow as part of a larger stream for which items in the stream may have previously failed, and so it wouldn't make sense to send an HTTP request. In other words, I really want a flow with type something

[akka-user] Akka stream - design of Bidi flow between client/server

2016-04-11 Thread Clelio De Souza
Hi there, I am trying to design a Bidi Flow between a client and server. The idea is for the server (upon receiving a TCP inbound connection) start sending data ("Hello" messages) on a interval of every 2 seconds to the connected client. The client also sends "Ping" messages (every 5 seconds)

Re: [akka-user] [Akka Stream] Exceptions in AbstractInHandler and AbstractOutHandler

2016-03-05 Thread hbf
Thanks, √! On Friday, February 12, 2016 at 12:19:23 AM UTC-8, √ wrote: > > They will fail the stage if they throw > > -- > Cheers, > √ > On Feb 12, 2016 8:54 AM, "hbf" wrote: > >> Hey everybody, >> >> The documentation doesn't say how exceptions in a GraphStage's handlers (

  1   2   3   4   5   >