adobe / aio-lib-java

Adobe I/O - Java SDK
https://opensource.adobe.com/aio-lib-java/
Apache License 2.0
5 stars 18 forks source link

feat: enhance Feign utility using resiliency4j retries #149

Closed nicdard closed 1 year ago

nicdard commented 1 year ago

Description

Currently, retries are implicitly enabled from Feign, using the Default Retryer and with a maximal number of attempts of 5.

The code changes enable the use of resiliency4j retries:

Other approaches:

  1. simply use the Default Retryer but configure a maximum number of retries of 3 (default is 5).
  2. Extend the Retryer interface and implement our custom logic (parameters are a bit different + in case of a negative interval from the header the default retryer doesn't wait)

I think we might be good with just (1) if we do not need any other resiliency pattern, which involves only adding 1 line when creating the Feign builder:

       .retryer(new Default( ... , ... , 3)) // can configure startInterval and maxInterval, last is the number of attempts

Related Issue

150

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

Checklist:

nicdard commented 1 year ago

See the simplified approach with Feign Retryer: https://github.com/adobe/aio-lib-java/pull/151