yes, a failure in the stream could lead to cancellation of the upstream
stages of where the error was induced. it basically is the way a stream is
being shut down on a failure.

On Jun 26, 2017 21:04, "Josh F" <[email protected]> wrote:

> Hi Konrad,
>
> Thanks for the reply!
>
> I can't really share the full snippet as it has a load of company-specific
> code in there, but good to know that the code I pasted would never cancel.
> I will try to figure out if something else is causing the application to
> stop.
>
> Just wondering, if I didn't have the recoverWith and my handler could
> return a failed future, could that cause the downstream to cancel?
>
> Also not sure if it makes a difference, but I do have a throttler before
> the mapAsync call:
> .throttle(elements = 1, per = 2, maximumBurst = 1, ThrottleMode.shaping)
>
> Thanks,
> Josh
>
>
>
> On Monday, June 26, 2017 at 7:25:38 PM UTC+1, Konrad Malawski wrote:
>>
>> Could you share the full snippet?
>> The code as pasted above would not cancel (downstream cancels, but a
>> Sink.ignore never would cancel).
>> Are you sure you’re not terminating the app or something else that would
>> cause the stream to stop?
>> — Konrad
>>
>>
>> On June 27, 2017 at 3:23:04 AM, Josh F ([email protected]) wrote:
>>
>> Hi all,
>>
>> I am new to akka-streams - I've just set up a basic pipeline which
>> consumes from a messaging queue and then does some processing on the stream.
>> But after running for a while, the application ceases to process
>> messages, apparently because the downstream has been "cancelled" and
>> onDownstreamFinish has been called on the source.
>>
>> I just want to know what the reason for this might be? What would cause
>> the downstream to be cancelled?
>>
>> For context, my pipeline is very simple - it looks like this:
>>
>> def source: Source[MyMessage, NotUsed] = ....
>> def messageHandler(message: MyMessage): Future[Unit] = {
>>   val result = .... // Some code here which processes the message and
>> returns a Future[Unit]
>>   result.recoverWith {
>>     case _ => Future.successful()
>>   }
>> }
>> def pipeline = source.mapAsync(10)(messageHandler)
>> pipeline.runWith(Sink.ignore)
>>
>> Note that the use of recoverWith means that the message handler will
>> always return a future which completes successfully - even if an exception
>> is thrown somewhere.
>>
>> Is anyone able to offer some advice / insight into what might be
>> happening?
>>
>> Thanks,
>> Josh
>>
>>
>>
>> --
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/c
>> urrent/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 [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
> >>>>>>>>>> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>>>>>>>>>      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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to