Creates a BidiFlow that can be used to provide Retry functionality.
Creates a BidiFlow that can be used to provide Retry functionality. This API is specifically for flows that are using Try's for elements that may occasionally fail. By default, any Failure is considered a failure that should be retried. However, a failureDecider function can be specified to control what constitutes a failure.
Retry functionality requires each element passing through this flow to be uniquely identifiable for retrying, so it requires a Context, of any type carried along with the flow's input and output element as a Tuple2 (Scala) or Pair (Java). The requirement is that either the Context type itself or a mapping from Context should be able to uniquely identify each element passing through flow.
Here are the ways a unique id can be provided:
uniqueIdMapper
This stage supports a default in-flight maximum number of elements based on stage Attribute InputBuffer max. This maximum buffer size includes all elements currently failing (and being re-tried) as well as any elements in-flight. To increase this size you can update the stage attribute max value for InputBuffer.
the type of elements pulled from upstream along with the Context
the type of the elements that are pushed to downstream along with the Context
the type of the context that is carried along with the elements.
the maximum number of retry attempts on any failures before giving up.
the function that maps Context to a unique id
function to determine if an element passed by the joined Flow is actually a failure or not
the overflowStrategy to use on Retry buffer filling
a BidiFlow with Retry functionality
Java API
Java API
above for details about each parameter.
Java API
Java API
above for details about each parameter.
Java API
Java API
above for details about each parameter
Java API Creates a akka.stream.javadsl.BidiFlow that can be joined with a akka.stream.javadsl.Flow to add Retry functionality with uniqueIdMapper, custom failure decider and OverflowStrategy.