Recover will catch an exception coming from upstream and continue by
emitting a single element before completing. Indeed does not sound like
what you are after.

Maybe the retry stream in akka-stream-contrib could give you some
inspiration on how to solve your problem:
https://github.com/akka/akka-stream-contrib/blob/master/contrib/src/main/scala/akka/stream/contrib/Retry.scala

--
Johan
Akka Team

On Wed, Apr 5, 2017 at 5:15 PM, scallahan via Akka User List <
[email protected]> wrote:

> Hey all,
>
> In my example below I have a source queue. In the middle I have a flow
> that can fail for a few different network related reason and all I want to
> do is drop the request back in the top of the funnel. But I am not entirely
> sure how I can get access to the element that went into the flow and caused
> the failure.
>
> val queue = Source.queue[ArchiveValidationRequest](50,
> OverflowStrategy.fail)
> queue.via(alwaysOnFlow).recover {
>   case ex: Throwable =>
>     error("Element failed. Reinserting back into queue to be processed")
>     queue.offer(???)
> }
>
> This seems like a fairly basic pattern but its not super obvious how to
> get that failed request. recoverWithRetries doesn't seem to be what I want
> here as I just want to capture the failed element and just try to process
> it later.
>
> --
> >>>>>>>>>> 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