[akka-user] Delay within GraphStageLogic

2016-08-25 Thread Gary Struthers
Hi, I'm handling exceptions in a custom GraphStage, with some exceptions I want to retry after a delay. Is there a preferred way to do this? Do I just call Thread.sleep? Gary -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ: >>

Re: [akka-user] Re: Cluster actors an parallelism

2016-08-25 Thread Cosmin Marginean
Thanks Patrik. I was hoping there would be a more flexible (and less hardcoded way to do this) > On 25 Aug 2016, at 18:41, Patrik Nordwall wrote: > > Start more worker actors on each node, each with a different name, let's say > worker1, worker2, worker3. Then in

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] Re: Cluster actors an parallelism

2016-08-25 Thread Patrik Nordwall
Start more worker actors on each node, each with a different name, let's say worker1, worker2, worker3. Then in the config you define all 3 in the paths "paths": ["/user/worker1", "/user/worker2", "/user/worker3"] /Patrik On Thu, Aug 25, 2016 at 4:41 PM, Cosmin Marginean

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

Re: [akka-user] Re: Cluster actors an parallelism

2016-08-25 Thread Cosmin Marginean
Thanks, I will try to do further diagnosis, however this is a last resort. I believe I would like to understand if this kind of use case is something that Akka would natively be delivering in one form or another and / or if I'm missing a trick in terms of correct router/etc that I'm using here.

Re: [akka-user] Re: Cluster actors an parallelism

2016-08-25 Thread Justin du coeur
Smells like the problem is somewhere in the router? I mean, if you're only processing one message at a time, that suggests that you've only got one instance of the worker Actor running, instead of the 100 that it's trying to declare. I don't use routers, so I can't speak to this config, but

[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] How to join three streams but output only when one emits an object?

2016-08-25 Thread Endre Varga
Hi Mark, On Thu, Aug 25, 2016 at 2:48 PM, Mark Hammons wrote: > I want to zip three streams together and form a class which will be output > to a sink. > That is so far a ZipWith > however, this class should only be emitted when the first stream emits an > item,

[akka-user] Re: Cluster actors an parallelism

2016-08-25 Thread Cosmin Marginean
Hi Muthu I've explored these but they're not exactly what I'm after. The use case is as follows: we have let's say 5 nodes, and 3 of them serve as "workers". These 3 should be processing a series of events/messages in parallel. We thus want some "load balancing" (consistent hashing is rigid

[akka-user] How to join three streams but output only when one emits an object?

2016-08-25 Thread Mark Hammons
I want to zip three streams together and form a class which will be output to a sink. however, this class should only be emitted when the first stream emits an item, instead taking the two latest items emitted by the other streams. Is there a way to do this in Akka? I can get it working in

[akka-user] Re: Cluster actors an parallelism

2016-08-25 Thread Muthukumaran Kothandaraman
Hi Cosmin, Are these what you are looking for http://doc.akka.io/docs/akka/snapshot/scala/routing.html#ConsistentHashingPool_and_ConsistentHashingGroup OR http://doc.akka.io/docs/akka/snapshot/scala/routing.html#BroadcastPool_and_BroadcastGroup Regards Muthu On Thursday, 25 August 2016

[akka-user] ControlAwareMailbox and Dequebased Mailbox

2016-08-25 Thread pavan prabhu
Hi all, I have a requirement where in i need both control as well as Deque based mailbox into one mailbox i.e I will be having two different types of messages, one normal ones and the other are control messages.When ever i receive a control message i need to stash my normal messages that

[akka-user] Cluster actors an parallelism

2016-08-25 Thread Cosmin Marginean
Hello everyone We have a classic scenario with a cluster with 2 tiers where one is a "worker" that we offload heavy processing to. We wired Akka clustering and have the following setup for a remote actor that is to be executed only on the worker tier. "/frontend/backend": { "router":

[akka-user] Re: How can I decode an HttpResponse

2016-08-25 Thread André
Hi Barrett, you can try Http() .singleRequest(...) .map(_.entity.dataBytes.via(Gzip.decoderFlow)) HTH, André On Thursday, August 25, 2016 at 9:41:14 AM UTC+2, Barrett Kern wrote: > > Hello, > > I am consuming a 3rd party API that returns gzipped JSON. I So far I > cannot figure out how

[akka-user] How can I decode an HttpResponse

2016-08-25 Thread Barrett Kern
Hello, I am consuming a 3rd party API that returns gzipped JSON. I So far I cannot figure out how to decompress this response. I found the directives for encoding/decoding but it seems (to me) that those have to be used in the routing dsl? The high level use case I have is user makes a