[akka-user] Blocking operations in actors and BlockContext

2016-02-03 Thread rklaehn
Hi all, quick question: when I do a blocking call from inside an akka actor, should I wrap it with scala.concurrent.blocking { ... } ? Cheers, Rüdiger p.s. I am well aware that this is something you should avoid if at all possible, and do on a dedicated dispatcher if you can't avoid this.

Re: [akka-user] SubFlow.to

2016-02-03 Thread Francesco Di Muccio
Il giorno mercoledì 3 febbraio 2016 01:54:55 UTC+1, rrodseth ha scritto: > > No worries. I wish I had the time and expertise to help. > > I don't mean to be a pest, but since my credibility with management is at > stake [ :) ] can anyone suggest any ways I can tackle the problem of > groupBy

Re: [akka-user] How to keep a Source alive

2016-02-03 Thread Endre Varga
Hi Claudio, I don't really understand your question here, a Source is alive until you close its output port. Can you show a simplified code example of what you mean? -Endre On Wed, Feb 3, 2016 at 12:04 AM, clca wrote: > I searched through the topics but I could not find

Re: [akka-user] Blocking operations in actors and BlockContext

2016-02-03 Thread Roland Kuhn
No, it will allocate as many threads in addition as are used by blocking sections—unless the thread factory returns `null` at some point (which we didn’t know back then, so it is not yet implemented as a limiting feature). ForkJoinPool is really intended for fork-join computations, we just use

[akka-user] Re: How to keep a Source alive

2016-02-03 Thread john . vieten
I've done something similar. I adapted this JobManager . When no data is available( for example when it recieves a Request(16) Messag) it starts a" polling Actor" which polls an external Database for

Re: [akka-user] SubFlow.to

2016-02-03 Thread Roland Kuhn
Yes, this is exactly what I was referring to, and I hope it is clear that we don’t want to show this approach to users in the Activator template—we need a better solution :-) Thanks Francesco! Regards, Roland > 3 feb 2016 kl. 10:31 skrev Francesco Di Muccio : >

Re: [akka-user] How to keep a Source alive

2016-02-03 Thread Viktor Klang
Perhaps a Source with a buffer attached with the appropriate dropping strategy? -- Cheers, √ On Feb 3, 2016 9:17 AM, "Endre Varga" wrote: > Hi Claudio, > > I don't really understand your question here, a Source is alive until you > close its output port. Can you show

Re: [akka-user] Blocking operations in actors and BlockContext

2016-02-03 Thread rklaehn
Thanks. If I set fork-join-executor.parallelism-max to some reasonable value, the dispatcher will not allocate more threads even when entering blocking sections, right? Cheers, Rüdiger On Wednesday, February 3, 2016 at 11:53:59 AM UTC+1, rkuhn wrote: > > The problem with this approach is

Re: [akka-user] Message Ordering in Akka

2016-02-03 Thread Roland Kuhn
Yes, messages are enqueued in the remoting layer such that the original ordering constraint it upheld, then transmitted in sequence and delivered to recipient mailboxes in that same sequence as well (synchronously—beware of bounded mailboxes with push timeout > 0). In short, we rely upon the

Re: [akka-user] Re: Akka 2.4+, Java 8 low latency micro-services JVM GC options

2016-02-03 Thread Guido Medina
This is not something easily testable with JMH as you don't measure performance but consistent performance, I have the application I'm working on logging times and I what I expect is to not see GC hiccups or longer pauses that you can clearly see the average time jump because of a full GC

Re: [akka-user] Akka Stream - Source.actorPublisher seems to create multiple instances of my ActorPublisher

2016-02-03 Thread Patrik Nordwall
That is not expected, and I have a hard time thinking that Akka streams would create it twice accidentally. Sure you don't run it twice? /Patrik On Fri, Jan 29, 2016 at 1:26 AM, gavares wrote: > I'm attempting to create an actor that extends ActorPublisher and then > create a

Re: [akka-user] Akka Remote - Max message size

2016-02-03 Thread Patrik Nordwall
500 kB might be alright if you adjust maximum-frame-size, but in general you should avoid sending large messages because they will delay other important messages that are sent over the same TCP connection, such as cluster heartbeat messages. Try to split up the large messages to several smaller

Re: [akka-user] Re: Akka 2.4+, Java 8 low latency micro-services JVM GC options

2016-02-03 Thread Viktor Klang
Do you have a jmh bench for testing this? -- Cheers, √ On Feb 3, 2016 1:58 PM, "Guido Medina" wrote: > For what I could gather and after 2012 bug fixed on the Linux kernel for > NUMA it is safe and profitable to use NUMA, though I'm not fully aware if > G1GC is NUMA-aware,

Re: [akka-user] Blocking operations in actors and BlockContext

2016-02-03 Thread Roland Kuhn
The problem with this approach is that it opens up that dispatcher to use unbounded resources—unless you know that the number of concurrent blocking{} calls is bounded sensibly in your program. Other than that it should work as a band-aid. An alternative might be to use the

[akka-user] Re: Akka 2.4+, Java 8 low latency micro-services JVM GC options

2016-02-03 Thread Guido Medina
For what I could gather and after 2012 bug fixed on the Linux kernel for NUMA it is safe and profitable to use NUMA, though I'm not fully aware if G1GC is NUMA-aware, at least JVM is not complaining about it: -

Re: [akka-user] Akka LARS and thread pool

2016-02-03 Thread Patrik Nordwall
On Tue, Feb 2, 2016 at 6:14 PM, Abe Sanderson wrote: > I'm wondering the impact of long delays in scheduled events, on the order > of perhaps one day; in the past I've implemented this as an event to hold > an expected delay and compares against a start time stored as

Re: [akka-user] Akka Stream - Source.actorPublisher seems to create multiple instances of my ActorPublisher

2016-02-03 Thread Endre Varga
>From what exactly do you conclude that two actors are created? Can you create a simple reproducer that we can run for ourselves to see the problem? Please also specify which version do you use. On Wed, Feb 3, 2016 at 1:51 PM, Patrik Nordwall wrote: > That is not

[akka-user] Re: Akka HTTP Performance (2.4.2-RC1)

2016-02-03 Thread Guido Medina
That has been reported and resolved, tried 2.4.2-CR2 which was released yesterday I think. On Wednesday, February 3, 2016 at 8:05:18 PM UTC, tigerfoot wrote: > > Hello, > > I'm running some simple HTTP performance measurements. I've created a > trivial "ping" endpoint (blindly returns "pong")

[akka-user] Re: Akka HTTP Performance (2.4.2-RC1)

2016-02-03 Thread Guido Medina
Sorry I meant try 2.4.2-RC2 On Wednesday, February 3, 2016 at 8:18:22 PM UTC, Guido Medina wrote: > > That has been reported and resolved, tried 2.4.2-CR2 which was released > yesterday I think. > > On Wednesday, February 3, 2016 at 8:05:18 PM UTC, tigerfoot wrote: >> >> Hello, >> >> I'm running

Re: [akka-user] SubFlow.to

2016-02-03 Thread Richard Rodseth
To be clear, I didn't mean concurrent writes to the same file, I meant writing multiple per-key files simultaneously. And I get that the example given achieves that because of the mapAsync performed on the head of the substream. As far as general semantics of groupBy, I think I get it. Per

Re: [akka-user] Re: How to keep a Source alive

2016-02-03 Thread Viktor Klang
http://doc.akka.io/api/akka-stream-and-http-experimental/2.0.3/?_ga=1.45749860.1579561034.1353497989#akka.stream.scaladsl.Source$ On Wed, Feb 3, 2016 at 11:06 PM, wrote: > where do I find unfold/unfoldAsync ? I looked at >

Re: [akka-user] Akka HTTP Performance (2.4.2-RC1)

2016-02-03 Thread Viktor Klang
https://groups.google.com/forum/#!topic/akka-user/Cb_wg7nVbx4 On Wed, Feb 3, 2016 at 9:05 PM, tigerfoot wrote: > Hello, > > I'm running some simple HTTP performance measurements. I've created a > trivial "ping" endpoint (blindly returns "pong") in Akka HTTP and hit it > like

Re: [akka-user] Re: CORS Support Akka-http

2016-02-03 Thread tdrozdowski
Seems like as of akka-http 2.0.3 the pre-flight OPTIONS handling via RejectionHandler no longer works as expected - at least if you're trying to use the directive once to wrap all routes. It appears that the behavior of akka-http is to only return the first HttpMethod that was rejected - even

[akka-user] ClusterRouterPool and Actors w/ non-serializable fields

2016-02-03 Thread bitsofinfo . g
Hi, I am trying to define a ClusterRouterPool that manages a BalancingPool of Actors across my cluster. The actual end Actor that does the work uses the Gson library which is not Serializable. When I bring up a 2nd node in the cluster, as it joins the primary node, I get

[akka-user] Re: akka cluster remote actor call "dead letters encountered"

2016-02-03 Thread bitsofinfo . g
Figured this out, my akka.cluster.roles were mis-matched On Wednesday, February 3, 2016 at 12:49:52 PM UTC-7, bitsof...@gmail.com wrote: > > I have a small test Akka cluster setup with 2 nodes. > > On node1 I have an actor @ /user/myactor1 (myactor1 is a BalancedPool > router wrapped in a

Re: [akka-user] Re: How to keep a Source alive

2016-02-03 Thread john . vieten
where do I find unfold/unfoldAsync ? I looked at http://doc.akka.io/docs/akka-stream-and-http-experimental/2.0.3/stages-overview.html? Many Greetings John Am Mittwoch, 3. Februar 2016 20:51:17 UTC+1 schrieb √: > > I don't see why you'd need to write a custom GraphStage for this. > >

Re: [akka-user] SubFlow.to

2016-02-03 Thread Francesco Di Muccio
Il giorno mercoledì 3 febbraio 2016 15:30:29 UTC+1, rrodseth ha scritto: > > Thanks very much. Actually, I would argue this is preferable to what's in > the template now, and both deserve a juicy comment! > > Does groupBy alone introduce any parallelism? With/without fusing? In this > example,

Re: [akka-user] SubFlow.to

2016-02-03 Thread Richard Rodseth
Thanks very much. Actually, I would argue this is preferable to what's in the template now, and both deserve a juicy comment! Does groupBy alone introduce any parallelism? With/without fusing? In this example, if there were n log levels rather than 5, would more than 5 files be written

[akka-user] AKKA- Handling state data using "FSM with Java 8 - Lambda support"

2016-02-03 Thread Mahesh Govind
Dear Experts, Reference : http://doc.akka.io/docs/akka/snapshot/java/lambda-fsm.html I could see different flavors of "matchevent" . I confused a bit in handling the state data .How state data is accessed from actions ( Lambdas) is not very clear . It will be great if you could help in

Re: [akka-user] SubFlow.to

2016-02-03 Thread Richard Rodseth
Ok. I suppose I should examine the GroupBy or SubFlow source code, but if I understand correctly different stages will run concurrently (if fusing is off or async boundaries have been added), but there's not a separate actor for each substream in a SubFlow? On Wed, Feb 3, 2016 at 7:35 AM,

Re: [akka-user] Akka Synchronous Logging

2016-02-03 Thread Nicholas Phillips
Thanks for the responses, all. I plan to move forward with the logback AsyncAppender, just because that's what we're already using. In the event that proves to be problematic, it seems like log4j2's async implementation can squeak out a bit more speed. On Wednesday, February 3, 2016 at

Re: [akka-user] Re: ANNOUNCE: Akka 2.4.2-RC2

2016-02-03 Thread Patrik Nordwall
I don't know about mvnrepository but they are listed here http://search.maven.org/#search%7Cga%7C1%7Cakka-http I agree with you that the documentation should include a section on what dependency that is needed for a specific module. Please create an issue and a pull request. /Patrik tors 4 feb.

[akka-user] Akka Stream Parallelism

2016-02-03 Thread RC213V
Hi, I have a sample akka stream code where my source is a preloaded .5 Gb of data from disk which is split into lines. Each line is about 2.5Kb. I create a runnable graph where i add processing parallelism by doing a balance ~> processing flow ~> merge before it goes into a dummy sink. The

[akka-user] Akka Stream fundamentals, and blocking

2016-02-03 Thread devorb arkash
Hi Guys, I don't understand a couple of things about akka streams: 1. are they based on actors or not? 2. I know I should not execute long running operations in actors (blocking things) because of the actors thread pool will be blocked. Can I do that inside a GraphStage? 3. Why are they 2 ways

[akka-user] Re: ANNOUNCE: Akka 2.4.2-RC2

2016-02-03 Thread gwanggaeto
In mvnrepository.com, I found the new akka stream dependencies, but not the new akka http dependencies. So when you make these radical changes to Akka, it would be most helpful if you could list the actual set of set dependencies for the very few developers that actually use Akka. Thanks in

[akka-user] Re: Message Ordering in Akka

2016-02-03 Thread Joseph Noir
> Imagine there is a dedicated mailbox per remote TCP connection [...] > Is the assumption that messages are always exchanged via TCP? So if many actors from node 1 to node 2, each actor individually can only > queue its messages sequentially, interleaving messages will only happen > between

Re: [akka-user] `sbt compile` formats hundres of files and fails on current master

2016-02-03 Thread Patrik Nordwall
Sounds strange. What operating system is this? Some file encoding setting that is wrong? We are using utf-8, but I have not heard anyone having problems with that from sbt. /Patrik On Tue, Jan 26, 2016 at 6:02 AM, Daniel Moran wrote: > Hello, > > I'm interested in

Re: [akka-user] SubFlow.to

2016-02-03 Thread Richard Rodseth
Write sub streams to files as fast as possible. But this latest was just me trying to understand groupBy. I'm unclear whether the substreams are processed concurrently (in the case where there is no mapAsync). In other words if I call to() to pipe all substreams to the same actor will the actor

Re: [akka-user] SubFlow.to

2016-02-03 Thread Roland Kuhn
This is actually not completely correct, the mapAsync is called only once (because prefixAndTail emits only a single element), hence there is no problem with concurrency. The issue is that handing these “live” sources down a stream pipeline carries the risk of losing them between stages

Re: [akka-user] SubFlow.to

2016-02-03 Thread Viktor Klang
I don't understand the question: What are you trying to achieve? On Wed, Feb 3, 2016 at 5:55 PM, Richard Rodseth wrote: > Ok. I suppose I should examine the GroupBy or SubFlow source code, but if > I understand correctly different stages will run concurrently (if fusing is >

[akka-user] Re: akka-http websockets: Connection closed before receiving a handshake response

2016-02-03 Thread Roberto Leibman
Damn it... more info. So, I tried removing the authentication by hardcoding the user, just to see what would happen, and I get: path("processStatusUpdate") { handleWebsocketMessages { processStatusUpdateFlow(LdapUser(dn = "rleibman", uid = "rleibman", givenName =

[akka-user] akka-http websockets: Connection closed before receiving a handshake response

2016-02-03 Thread Roberto Leibman
The chrome dev console is showing this message when the page starts - WebSocket connection to 'wss://www.example.com:8083/processStatusUpdate' failed: Connection closed before receiving a handshake response Error happened [object Event] OnClose was successful 1006- --- My

[akka-user] Re: akka-http websockets: Connection closed before receiving a handshake response

2016-02-03 Thread Roberto Leibman
BTW, using akka-http 2.0.3 (but it was happening on 2.0.2 as well) and scalajs 0.8.2 with scalajs-react 0.10.4 On Wednesday, February 3, 2016 at 10:46:10 AM UTC-8, Roberto Leibman wrote: > > The chrome dev console is showing this message when the page starts > > - > WebSocket connection

Re: [akka-user] SubFlow.to

2016-02-03 Thread Viktor Klang
Put in async boundaries where you want to have them. And writing to file concurrently is likely not faster, but as always needs to be measured. On Wed, Feb 3, 2016 at 6:55 PM, Richard Rodseth wrote: > Write sub streams to files as fast as possible. But this latest was just >

Re: [akka-user] SubFlow.to

2016-02-03 Thread Francesco Di Muccio
Il giorno mercoledì 3 febbraio 2016 19:05:21 UTC+1, rkuhn ha scritto: > > This is actually not completely correct, the mapAsync is called only once > (because prefixAndTail emits only a single element), hence there is no > problem with concurrency. > > Well, I explained myself bad, I meant

[akka-user] Akka HTTP Performance (2.4.2-RC1)

2016-02-03 Thread tigerfoot
Hello, I'm running some simple HTTP performance measurements. I've created a trivial "ping" endpoint (blindly returns "pong") in Akka HTTP and hit it like this: val now = System.currentTimeMillis() (1 to 500).foreach(i => { HttpUtil.send(HttpRequest(uri =