Re: [akka-user] Spray-json support and FromResponseUnmarshaller

2016-04-20 Thread loempl
Edmondo, You can’t expect unmarshalling to magically unfold the Future you get back. Hence you have to map. Or, to be more precise, you have to flatMap, because unmarshalling returns another Future. ``` responseFuture.flatMap(Unmarshal(_).to[MyClass]) // Notice that you’re still in Future

Re: [akka-user] What are the correlation between ByteString in Akka Streams TCP packet payloads?

2016-04-20 Thread Magnus Andersson
Hi So the statefulMapConat was what I used at first, but the implementation became a mess. I'll try to give a richer example of what I am missing in streams in this particular case. My original approach was a bit naive. I wished to model the protocol and state transitions as a flow graph. I

[akka-user] Spray-json support and FromResponseUnmarshaller

2016-04-20 Thread Edmondo Porcu
Hello, I am using Spray-json support and I have correctly implemented my json protocol by providing implicit RootJsonFormat. Are there available (implicit) conversions to - lift the FromEntityUnmarshaller[MyClass] provided by Spray Json into a FromResponseUnmarshaller[MyClass] - lift a

Re: [akka-user] Question: Regarding reactive streams and threads / dispatcher

2016-04-20 Thread Thomas Zimmer
Thanks for pointing this out Endre. At least I got an idea where I should look at On Wednesday, April 20, 2016 at 11:14:06 AM UTC+2, Akka Team wrote: > > Hi Thomas, > > > it seems to spawn a new thread per connection (new > akka-default-dispatcher- keep popping up). Here is how i spawn my >

Re: [akka-user] What are the correlation between ByteString in Akka Streams TCP packet payloads?

2016-04-20 Thread Endre Varga
Yes, this is a simple approach and works without having to do a custom stage (exactly why statefulMapConcat was introduced). -Endre On Wed, Apr 20, 2016 at 4:03 PM, Derek Williams wrote: > If it helps, a simple custom framing stage could look like this: > >

[akka-user] Re: akka/parboiled2/ParserInput Not found but only when running scalatest in Scala Ide

2016-04-20 Thread yonatan cale
Hi, I have the same problem, could you tell me where you made this change? Is it one of these: https://www.jetbrains.com/help/idea/2016.1/working-with-build-configurations.html?origin=old_help#build_configuration_dependencies Thanks! On Wednesday, June 3, 2015 at 2:02:58 AM UTC+3, Gary

Re: [akka-user] What are the correlation between ByteString in Akka Streams TCP packet payloads?

2016-04-20 Thread Derek Williams
If it helps, a simple custom framing stage could look like this: Flow[ByteString].statefulMapConcat[MyThing] { () => var buffer = ByteString.empty in => { val (things, remaining) = parseThings(buffer ++ in) buffer = remaining things } } def parseThings(bytes: ByteString):

Re: [akka-user] What are the correlation between ByteString in Akka Streams TCP packet payloads?

2016-04-20 Thread Magnus Andersson
Solved it by doing my own version of something similar to the framing classes. Perhaps a custom stage is what I should use for problems like a protocol with variable length payloads, acking on application level, messages received in a specific order? Doing it with flows or graphs seemed to

Re: [akka-user] Akka HTTP Java Directives examples

2016-04-20 Thread Daniel Stoner
Thank you Konrad. Having just finished the 2.4.4 upgrade I think you've all done a great job on moving user closer to the native Java 8 styling which can only be a good thing long term for adopters of the framework. On 20 April 2016 at 13:23, Konrad Malawski

Re: [akka-user] Akka HTTP Java Directives examples

2016-04-20 Thread Konrad Malawski
As explained in the release notes on Akka.io/news we had to expedite the release of 2.4.4 as 2.4.3 had some blocker issues for users of https. Since then we continue to focus explicitly on the javadsl, spent entire weeks specifically on polishing it recently :) We think we'll be ready to ship it

Re: [akka-user] Akka HTTP Java Directives examples

2016-04-20 Thread Daniel Stoner
Hi Konrad/Others, I notice that Github issue was taken over into: https://github.com/akka/akka/pull/20088 and has not made it yet into v2.4.4. Is it on the roadmap for 2.4.5 or is there any update about plans for this? Thanks kindly, Daniel Stoner On 15 February 2016 at 16:00, Konrad Malawski

[akka-user] akka-http how to transform a HttpResponse in a flow and apply backpressure?

2016-04-20 Thread Fernando Benjamin
Hi, I have a client example where it connects via Http to a server that streams json events to the client, by keeping the continuous open. val fromHttpResponseToString: Flow[HttpResponse, String, NotUsed] = Flow[ HttpResponse].mapAsync(1)(Unmarshal(_).to[String]) val validRequestFilter:

Re: [akka-user] Question: Regarding reactive streams and threads / dispatcher

2016-04-20 Thread Akka Team
Hi Thomas, > it seems to spawn a new thread per connection (new akka-default-dispatcher- keep popping up). Here is how i spawn my "ClientSession" - Actor: Are you calling blocking calls somewhere? Nothing in Akka's TCP stack creates new threads, they only create actors. The only reason why the

Re: [akka-user] Code example of Akka Stream where Source is bulk data (records read in chunks)

2016-04-20 Thread Akka Team
Hi, You can use - Source.unfold() ( http://doc.akka.io/api/akka/2.4.4/index.html#akka.stream.scaladsl.Source$@unfold[S,E](s:S)(f:S=>Option[(S,E)]):akka.stream.scaladsl.Source[E,akka.NotUsed]l) - if you have a non-blocking API, or you can use unfoldResourceAsync (

Re: [akka-user] Akka Singleton Cluster: resolveOnce of a worker by master fails after restart

2016-04-20 Thread Akka Team
Hi Prasanna, Please create a small, self-contained project that can be used to reproduce the issue. Then we can see what goes wrong. From your description I cannot figure out what you want to do and what do you expect to happen. -Endre On Sat, Apr 16, 2016 at 4:03 AM, Prasanna Thirumalai

Re: [akka-user] Handling HTTPS with Akka-http

2016-04-20 Thread Akka Team
Hi Bassam, The client does not fully support proxies, especially when it comes to Https: see https://github.com/akka/akka/issues/16853 -Endre On Fri, Apr 15, 2016 at 3:58 PM, Bassam Khallaf < eng.bassam.a.khal...@gmail.com> wrote: > Hello, > > Is there any tutorial or example related to

Re: [akka-user] Akka graph stream failed to produce output

2016-04-20 Thread Akka Team
What do you mean? It does produce output, I just tried it out. Also, don't use Stream.from, use Iterator.from instead as the former retains elements while the latter does not. -Endre On Wed, Apr 13, 2016 at 4:00 PM, Rajeev Kumar wrote: > I am just playing with

Re: [akka-user] Re: Connect two TCP sockets

2016-04-20 Thread Endre Varga
You can use Sink.queue to get a future based queue API that is backpressured. Then you can just combine with mapAsync on the sockets side to get backpressured merges. Not exactly the same as Hub would work, but already works for this simple case. -Endre On Wed, Apr 20, 2016 at 10:05 AM, Johan

Re: [akka-user] Akka recovery mechanism

2016-04-20 Thread Akka Team
Hi, On Wed, Apr 13, 2016 at 12:11 AM, Amruta wrote: > Does Akka use persistence id to get records from journal during recovery? > What do you exactly mean here? What happens is usually journal-specific I think, but every sane journal should query on the persistence id

Re: [akka-user] Re: ActorSystem.terminate() couldn't fully terminate the system

2016-04-20 Thread Akka Team
It is simply "akka.daemonic = on". I am not sure why you need it though. The threads will be gone anyway. If you cannot stop your application then you have some other issue. -Endre On Tue, Apr 19, 2016 at 6:03 PM, Yan Pei wrote: > Endre, > This is good to know. Could you

Re: [akka-user] Re: Connect two TCP sockets

2016-04-20 Thread Mike Limansky
Hi Johan, Thanks a lot. Now this part is clear for me. среда, 20 апреля 2016 г., 11:05:59 UTC+3 пользователь Johan Andrén написал: > > Hi Mike, > > There currently is no such stage, something like dynamic pub-sub (we have > some ideas that you can read about in this ticket: >

Re: [akka-user] Re: Connect two TCP sockets

2016-04-20 Thread Johan Andrén
Hi Mike, There currently is no such stage, something like dynamic pub-sub (we have some ideas that you can read about in this ticket: https://github.com/akka/akka/issues/19478 ), so to do that you would have to either write your own stage for it or

[akka-user] Re: Connect two TCP sockets

2016-04-20 Thread Mike Limansky
Hi Johan, I meant I'd like to merge data from all incoming connections to one output. вторник, 19 апреля 2016 г., 21:50:18 UTC+3 пользователь Johan Andrén написал: > > Hi Mike, > > The problem is that you create one outgoing connection, but you cannot use > that more than once. If you