Re: [akka-user] migrating from an earlier version of akka-streams ..

2016-04-26 Thread Debasish Ghosh
Thanks for the clarification. A good point to keep in mind. regards. On Wed, Apr 27, 2016 at 11:22 AM, Roland Kuhn wrote: > Hi Debasish, > > The current fusing algorithm is called «aggressive» for a reason: it will > fuse everything it can. To run the subflows in parallel you will have to > add

Re: [akka-user] migrating from an earlier version of akka-streams ..

2016-04-26 Thread Roland Kuhn
Hi Debasish, The current fusing algorithm is called «aggressive» for a reason: it will fuse everything it can. To run the subflows in parallel you will have to add a .async after the fold. But that will only be beneficial if the monoid’s |+| is rather expensive. Regards, Roland Sent from my

Re: [akka-user] migrating from an earlier version of akka-streams ..

2016-04-26 Thread Debasish Ghosh
Thanks Roland a lot for the clarification .. I can do this .. val netTxn: RunnableGraph[Future[akka.Done]] = transactions.map(validate) .groupBy(MaxGroupCount, _.accountNo) .fold(TransactionMonoid.zero)(_ |+| _) .mergeSubstreams Only difference

Re: [akka-user] migrating from an earlier version of akka-streams ..

2016-04-26 Thread Roland Kuhn
> 26 apr 2016 kl. 20:14 skrev Debasish Ghosh : > > Just for the sake of completeness, this works .. > > transactions.map(validate) > .groupBy(MaxGroupCount, _.accountNo) > .fold(Map.empty[String, Transaction])((l, r) => l |+| > Map(r.accountNo -> r)) > .merge

Re: [akka-user] migrating from an earlier version of akka-streams ..

2016-04-26 Thread Viktor Klang
The fold will be sequential On Tue, Apr 26, 2016 at 9:20 PM, Debasish Ghosh wrote: > Actually I realized just now that I don't need the groupBy and > mergeStreams for this .. Just the following will also do .. > > transactions.map(validate) > .fold(Map.empty[String, Transaction])((l,

[akka-user] Re: Actorpublisher as source in handleMessagesWithSinkSource

2016-04-26 Thread Morten Lund
Thanks Johan! I will read you blog post in details! Den tirsdag den 26. april 2016 kl. 20.54.09 UTC+2 skrev Morten Lund: > > I'm new to AKKA Streams. (Using Akka v 2.4.4) I am trying to create a > Websocket which can push new notifications to subscribed clients. My > strategy is to implement a

[akka-user] Re: Actorpublisher as source in handleMessagesWithSinkSource

2016-04-26 Thread Johan Andrén
Hi Morten, Maybe this blog post I wrote recently can be of use to you figure it out: https://markatta.com/codemonkey/blog/2016/04/18/chat-with-akka-http-websockets/ Cheers -- Johan Andrén Akka Team, Lightbend Inc. On Tuesday, April 26, 2016 at 8:54:09 PM UTC+2, Morten Lund wrote: > > I'm new to

[akka-user] Re: Bootstrapping akka-cluster from etcd - options?

2016-04-26 Thread 'Ryan Tanner' via Akka User List
I used to run an Akka cluster on top of etcd. I just had a wrapper script that grabbed seed hosts from etcd and passed them as flags to my java command. We were using fleetd to deploy our Akka cluster nodes as Docker instances. Each node had a sidekick job in fleetd that updated etcd with the

Re: [akka-user] migrating from an earlier version of akka-streams ..

2016-04-26 Thread Debasish Ghosh
Actually I realized just now that I don't need the groupBy and mergeStreams for this .. Just the following will also do .. transactions.map(validate) .fold(Map.empty[String, Transaction])((l, r) => l |+| Map(r.accountNo -> r)) And the example in the Streams Cookbook for counting words

[akka-user] Bootstrapping akka-cluster from etcd - options?

2016-04-26 Thread Val P
Hi, Does anyone have any experience with ConstructR or akka-cluster-etcd for bootstrapping an akka cluster off of etcd? How do the two compare, and are there other options? ConstructR: https://github.com/hseeberger/constructr akka-cluster-etcd: https://github.com/rkrzewski/akka-cluster-etcd --

[akka-user] Actorpublisher as source in handleMessagesWithSinkSource

2016-04-26 Thread Morten Lund
I'm new to AKKA Streams. (Using Akka v 2.4.4) I am trying to create a Websocket which can push new notifications to subscribed clients. My strategy is to implement a ActorPublisher, which I later can send a message to, and then get it pushed to clients. To get started I copied an example of a

Re: [akka-user] Https Protocol Configuration with JavaDSL

2016-04-26 Thread andreasjscholz
Thanks for the quick reply! Sadly your workaround does not fix the issue as i still do not get support for the newer TLS versions. However switching to 2.4-SNAPSHOT seems to solve the issue (maybe there is some other initialization stuff missing?), so I'll eagerly await the 2.4.5 release ;-)

Re: [akka-user] migrating from an earlier version of akka-streams ..

2016-04-26 Thread Debasish Ghosh
Just for the sake of completeness, this works .. transactions.map(validate) .groupBy(MaxGroupCount, _.accountNo) .fold(Map.empty[String, Transaction])((l, r) => l |+| Map(r.accountNo -> r)) .mergeSubstreams Since I cannot access the sub-streams I need to simula

Re: [akka-user] migrating from an earlier version of akka-streams ..

2016-04-26 Thread Viktor Klang
If you can devise a safe version of groupBy that lets us preserve that nice quality then I am more than all ears. -- Cheers, √ On Apr 26, 2016 8:02 PM, "Debasish Ghosh" wrote: > Thanks Viktor .. my main issue is that we lose the natural semantics of > groupBy as we learnt from SQL. We cannot ac

Re: [akka-user] migrating from an earlier version of akka-streams ..

2016-04-26 Thread Debasish Ghosh
Thanks Viktor .. my main issue is that we lose the natural semantics of groupBy as we learnt from SQL. We cannot access the substreams as separate abstractions that groupBy creates. On Tue, Apr 26, 2016 at 11:28 PM, Viktor Klang wrote: > Debasish, > > The problem with groupBy was that it was too

Re: [akka-user] migrating from an earlier version of akka-streams ..

2016-04-26 Thread Viktor Klang
Debasish, The problem with groupBy was that it was too easy to create leaks and silently broken solutions with it, but I sympathize with your situation, I also felt the original as being more ergonomic. I think there is room for improvement in the current solution. -- Cheers, √ On Apr 26, 2016 7

Re: [akka-user] migrating from an earlier version of akka-streams ..

2016-04-26 Thread Debasish Ghosh
Roland - The problem is I cannot access the substreams separately within the fold. In the earlier solution the fold was on individual substreams (not on the whole stream). Here the fold gets *all* the elements from all substreams and I lose the ability to process substreams separately. Hence I los

Re: [akka-user] migrating from an earlier version of akka-streams ..

2016-04-26 Thread Roland Kuhn
Instead of using a fold sink which materializes to a Future you’ll need to use a fold combinator which produces the result as its only value after the substream has completed, i.e. you keep the computation results within the streaming domain a bit longer instead of going to the Future domain im

Re: [akka-user] Re: migrating from an earlier version of akka-streams ..

2016-04-26 Thread Debasish Ghosh
There's no toMat in SubFlow .. which groupBy returns .. On Tue, Apr 26, 2016 at 10:03 PM, Viktor Klang wrote: > Sorry if I'm being daft, but shouldn't it be doing: > transactions.groupBy(maxSubstreams > = 100, _.accountNo).toMat(txnSink, Keep.right) > > On Tue, Apr 26, 2016 at 6:05 PM, Debasish

Re: [akka-user] Re: migrating from an earlier version of akka-streams ..

2016-04-26 Thread Viktor Klang
Sorry if I'm being daft, but shouldn't it be doing: transactions.groupBy(maxSubstreams = 100, _.accountNo).toMat(txnSink, Keep.right) On Tue, Apr 26, 2016 at 6:05 PM, Debasish Ghosh wrote: > Roland - > > I need to merge into a fold sink w/ a Monoid. Consider the following > example .. > > case c

[akka-user] Curious thing in cluster routee naming

2016-04-26 Thread Abe Sanderson
I am doing some experimenting using cluster aware round robin pool routers. I started to see some issues with dropped messages under heavy load, and went digging around in logs and in the akka code. With the cluster setup of 3 nodes, 2 instance per node, 6 total instance, I can see in logs cr

Re: [akka-user] Https Protocol Configuration with JavaDSL

2016-04-26 Thread Konrad Malawski
Manually specifying the protocols via ConnectionContext.https(...) does not seem to work. The method accepts a List of protocols as Optional<> parameter - however looking into the implementation at javadsl.ConnectionContext : 23 it seems these parameters are actually ignored and not passed on. T

Re: [akka-user] Https Protocol Configuration with JavaDSL

2016-04-26 Thread Konrad Malawski
And thanks for noticing the bug about not passing though params - we'll fix. --  Konrad `ktoso` Malawski Akka @ Lightbend On 26 April 2016 at 18:00:16, andreasjsch...@gmail.com (andreasjsch...@gmail.com) wrote: Hi, after switching from the experimental branch of http to http-core 2.11-2.4.4 I

Re: [akka-user] Https Protocol Configuration with JavaDSL

2016-04-26 Thread Konrad Malawski
This is a bug in the DSL. We've been focused on the new DSL and missed this omission in the current one. The workaround is to call this before you bind the app: void useHttps(ActorSystem system) { final HttpExt scalaHttp = (HttpExt) akka.http.scaladsl.Http.get(system); ​ try { final

Re: [akka-user] Re: migrating from an earlier version of akka-streams ..

2016-04-26 Thread Debasish Ghosh
Roland - I need to merge into a fold sink w/ a Monoid. Consider the following example .. case class Transaction(id: String, accountNo: String, debitCredit: TransactionType, amount: Amount, date: Date = today) and I have the following list of Transactions .. val txns = Seq( Transaction

[akka-user] Https Protocol Configuration with JavaDSL

2016-04-26 Thread andreasjscholz
Hi, after switching from the experimental branch of http to http-core 2.11-2.4.4 I have some issues w.r.t. TLS / https setup what has changed is that a https server based on http-core only offers support for TLSv1 and whereas the server based on http-experimental offers support for v1, v1.1 an

Re: [akka-user] Re: migrating from an earlier version of akka-streams ..

2016-04-26 Thread Roland Kuhn
If you need the results from the substreams you’ll have to merge them back into the mainstream and aggregate them there: transactions.groupBy(100, ...).fold(...).mergeSubstreams.grouped(100).to(Sink.head) Regards, Roland > 26 apr 2016 kl. 17:36 skrev debasish : > > Viktor - > > Here's the s

Re: [akka-user] Re: migrating from an earlier version of akka-streams ..

2016-04-26 Thread debasish
Viktor - Here's the same stuff that works for akka-streams version akka-stream-experimental 1.0 RC4. .. https://gist.github.com/debasishg/4d596c1f26d4759ed65e281bb2e6fd2c .. The upgrade that I am having trouble with is defining netTxn (pls see the gist). The groupBy works like a charm in the o

Re: [akka-user] Re: migrating from an earlier version of akka-streams ..

2016-04-26 Thread Viktor Klang
What are you expecting to be returned? -- Cheers, √ On Apr 26, 2016 3:49 PM, "Debasish Ghosh" wrote: > Thanks Konrad for the pointer .. when I run the graph I get a NotUsed .. > That's not hwat I get with the earlier implementation. Please have a look > at the gist .. > https://gist.github.com/

[akka-user] Akka Streams sometimes stop

2016-04-26 Thread Thiago Pereira
Hello guys, I'm trying to stream 6 millions of rows from Cassandra. I'm using phantom-dsl which gives me a play Enumerator, then I turn it to a Publisher, also using play library, this way I can make a Source like this: import org.reactivestreams.Publisher import play.api.libs.iteratee.Enumerat

Re: [akka-user] Re: migrating from an earlier version of akka-streams ..

2016-04-26 Thread Debasish Ghosh
Thanks Konrad for the pointer .. when I run the graph I get a NotUsed .. That's not hwat I get with the earlier implementation. Please have a look at the gist .. https://gist.github.com/debasishg/a42e867bb2bc8ad18243597178bbce93 .. what am I doing wrong. Thanks. On Tue, Apr 26, 2016 at 6:22 PM, K

[akka-user] Re: migrating from an earlier version of akka-streams ..

2016-04-26 Thread Konrad Malawski
(I did a quick mock Transaction type, your Monoid should work fine there ofc). -- Konrad On Sunday, 24 April 2016 21:42:43 UTC+2, debasish wrote: > > Hi - > > I am trying to migrate some akka-streams code from an earlier version > (akka-stream-experimental 1.0.RC4) .. please have a look at the

[akka-user] Re: migrating from an earlier version of akka-streams ..

2016-04-26 Thread Konrad Malawski
Hi Debasish, sorry for the delay, team meeting got us focused on planning things. It seems that in your case you don't need anything very weird, have you seen `to`? val txnSink: Sink[Transaction, Future[Transaction]] = Sink.fold[Transaction, Transaction](Transaction.zero)(_ + _) val netTxn: R

[akka-user] [ANN] Erlang Workshop 2016 - Second CFP

2016-04-26 Thread Erlang Workshop
Apologies for any duplicates you may receive. CALL FOR PAPERS === Fifteenth ACM SIGPLAN Erlang Workshop -- - Nara, Japan, September 23, 2016 Satellite event of the 21st ACM SIGPLAN International Conference on Functional

Re: [akka-user] Better way to use CompletableFuture in an Actor

2016-04-26 Thread Guofeng Zhang
Konrad, There is a similar case when using AbstractActorSubscriber. I have defined an actor by deriving from AbstractActorSubscriber. This actor also use WSClient to upload some data to the remote server. I guess I should not let this actor asynchronously execute its task, that might give incorr

Re: [akka-user] Re: from akka.persistence.journal.ReplayFilter Invalid replayed event [1] in buffer from old writer

2016-04-26 Thread Tim Pigden
sure, but I'm a contributor newbie - it looks like you have to approve my ticket (#20394) etc before I should do anything more On 26 April 2016 at 09:09, Patrik Nordwall wrote: > sounds good, would you like to open a pull request? > > On Tue, Apr 26, 2016 at 9:57 AM, Tim Pigden wrote: > >> Hi P

Re: [akka-user] Re: from akka.persistence.journal.ReplayFilter Invalid replayed event [1] in buffer from old writer

2016-04-26 Thread Patrik Nordwall
sounds good, would you like to open a pull request? On Tue, Apr 26, 2016 at 9:57 AM, Tim Pigden wrote: > Hi Patrik > If that's the intent of the warning, would it not be a good idea to make > it a little more explicit? For example add "check persistence ids" to the > code or drop a useful commen

Re: [akka-user] Re: from akka.persistence.journal.ReplayFilter Invalid replayed event [1] in buffer from old writer

2016-04-26 Thread Tim Pigden
Hi Patrik If that's the intent of the warning, would it not be a good idea to make it a little more explicit? For example add "check persistence ids" to the code or drop a useful comment line into the source code where the warning is emitted. Tim On 26 April 2016 at 06:39, Patrik Nordwall wrote: