Add retries for schema registry errors #673
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Initial PR for feedback - aims to fix #663
Goal
Prevent transient schema registry API errors from blowing up Vulcan ser/des by adding retries with sensible default config.
Implementation
IOException
orRestClientException
IOException
andRestClientException
(if non-client error code) toSerializationException
SerializationException
IOException
,RestClientException
,SerializationException
Notes
Temporal[F]
, which requires upgrading fromF: Sync
toF: Async
. Presumably this is considered a breaking change and so this feature needs to start targetting 3.x instead? I'm new to library code, just let me know 😄fs2-kafka-vulcan
(there's only a private, sealed interface infs2-kafka
core) so I have not added anycats-retry
Jitter[F]
, which we seem to want to move away fromdef schemaRegistryRetryPolicy[A]: (F[A], Throwable) => F[A]
- this would give good flexibility for clients and allow interop with libraries likecats-retry
. I really like this idea. Unfortunately I can't see a way to make this work: deserialization will return an arbitraryF[A]
andA
is basically a wildcard type that needs to accommodate any arbitraryvulcan.Codec[A]
. Wildcard types aren't supported for anonymous functions, e.g. I can't do:feedback on the interface very welcome!
TODO