Yes, that's what I'm doing. More precisely, I'm defining a composite Source 
like so:

Initial ~> Merge ~> Akka HTTP ~> Broadcast ~> Consumer
       +~>                                 ~>+ 
       |                                     |
       +~~~~~~~~~~~ Throttler <~~~~~~~~~~~~~~+
        
The Throttler flow contains a tick source, the Cancellable materialized 
value of which is externalized as the materialized value of the composite 
Source. The Akka HTTP stage sends a GET request to a remote system.

I have a small 'Runner' program that exercises the composite flow. It calls 
cancel after 40 seconds of execution. As you can see from the logging 
output, the loop closes in a less-than-happy fashion.

[info] 07/26 21:35:28 INFO  appspokes.onedrive.experimental.Runner - 
Cancelling stream

[info] akka.stream.StreamTcpException: The connection closed with error 
Connection reset by peer

[info] 07/26 21:35:58 ERROR experimental.Runner - FAILURE!

[info] akka.stream.StreamTcpException: The connection closed with error 
Connection reset by peer

[info] 07/26 21:35:58 DEBUG akka.stream.impl.fusing.ActorInterpreter - fail 
due to: The connection closed with error Connection reset by peer

[info] 07/26 21:35:58 INFO  experimental.Runner - Shutting down

[info] 07/26 21:35:58 DEBUG akka.stream.impl.fusing.ActorInterpreter - fail 
due to: The connection closed with error Connection reset by peer

[info] 07/26 21:35:58 DEBUG akka.stream.impl.Broadcast - fail due to: The 
connection closed with error Connection reset by peer

[info] 07/26 21:35:58 INFO  experimental.Runner - Actor system has been 
shut down

[info] 07/26 21:35:58 ERROR akka.stream.Materializer - [Sync Response] 
Upstream failed.

[info] akka.stream.StreamTcpException: The connection closed with error 
Connection reset by peer

[success] Total time: 74 s, completed 26/07/2015 9:35:59 PM


Now, I will confess that, much earlier in the program's execution, I'm 
seeing this:

[info] 07/26 21:35:03 DEBUG akka.stream.impl.PrefixAndTailImpl - Cancelling 
akka.stream.impl.MultiStreamOutputProcessor$SubstreamOutput@3216206b 
(after: 5000 ms)

...which I'm assuming is unrelated because it happens much earlier, and 
none of the error output occurs until the cancellation call is made.

I'd be happy to post the code here, but it's rather verbose. The essential 
part is probably this (yeah, Java. sorry):

builder.from(url).via(merge).via(polling(accessToken)).to(bcast.in());
builder.from(bcast.out(1)).via(throttler).via(nextLinks).to(merge); // loop-back
return bcast.out(0); // outlet to the world


I'll work on a minimized failing test case that does not involve HTTP 
requests, to see if the stream still completes with failure.  
 

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to