All Versions
53
Latest Version
Avg Release Cycle
87 days
Latest Release
-
Changelog History
Page 1
Changelog History
Page 1
-
v3.3.0 Changes
API Changes
ExecutionContext.getStartTime
now returns aInstant
rather thanDuration
, andExecutionEvent.getStartTime
now returnsOptional<Instant>
.- 🚚
getFailure
,getLastFailure
,recordFailure
and similar methods for recording Exceptions, which were previously deprecated, were removed. UsegetException
,getLastException
,recordException
, etc. instead.
-
v3.2.4 Changes
👌 Improvements
- ➕ Added additional thread safety checks.
-
v3.2.3 Changes
🐛 Bug Fixes
- 🛠 Fixed an issue where Timeouts would not fire under certain conditions when used outside a RetryPolicy.
-
v3.2.2 Changes
👌 Improvements
- 🚀 Released OkHttp module.
- 🚀 Released Retrofit module.
- ➕ Added
Call
support toFailsafeExecutor
, which can cancel synchrnous calls. - ➕ Added
onCancel
callback toExecutionContext
, which can propagate cancellations.
SPI Changes
- 🔀
SyncExecutionInternal.isInterruptable()
and.setInterrupted
were removed and.interrupt()
was added instead to simplify performing an interruption.
-
v3.2.1 Changes
👌 Improvements
- 👍 Issue #326 - Added support for reserving a
RateLimiter
permit with a wait time.
API Changes
- 🔧 Deprecated
ExecutionContext.getLastFailure
,Execution.recordFailure
and similar methods throughout that API that refer to exceptions as failures. In their place, new methods have been added, such asgetLastException
,recordException
and so on. This clarifies the difference between an exception and a failure, since an exception may or may not be a failure, depending on the policy configuration. - 🔄 Changed the policy builders to use
CheckedPredicate
andCheckedBiPredicate
instead ofPredicate
andBiPredicate
, allowing exceptions to be thrown which are ignored.
- 👍 Issue #326 - Added support for reserving a
-
v3.2.0 Changes
👌 Improvements
- Issue #309 - Introduced a
Bulkhead
policy. - Issue #318 - Add non-blocking async waiting for rate limiters.
SPI Changes
- 👍
PolicyExecutor.preExecuteAsync
was introduced to support async pre-execution. This is backwards compatible withpreExecute
.
- Issue #309 - Introduced a
-
v3.1.0 Changes
👌 Improvements
- Issue #308 - Introduced a
RateLimiter
policy.
- Issue #308 - Introduced a
-
v3.0.2 Changes
🐛 Bug Fixes
- Issue #311 -
with(Executor)
not working as expected in some cases.
- Issue #311 -
-
v3.0.1 Changes
👌 Improvements
- 🏗 Issue #310 - Added
.builder(PolicyConfig)
methods to each of the policy interfaces, to allow new policies to be built from existing config. - 🔧 Issue #251 - Relaxed the illegal state validation in
RetryPolicyBuilder
to allow different types of delays to be configured, replacing previous configuration. Also removed the requirement that a jitter duration be configured after a delay.
🐛 Bug Fixes
- Issue #215 - Added overflow checking for large user-provided
Duration
values.
- 🏗 Issue #310 - Added
-
v3.0 Changes
API Changes
🚀 This release introduces some breaking changes to the API:
General
- ⚡️ The maven group id for Failsafe has changed to
dev.failsafe
. Be sure to update your build config. - ⚡️ All files have been moved to the
dev.failsafe
package. Be sure to update your imports.
Policies
- 🏗 All policies now use a builder API. Using the builder API mostly requires inserting
builder()
andbuild()
methods into the call chain for constructing a policy since the actualwith
configuration methods are mostly the same as in 2.x policies, with a few changes described below. Some notes:- A policy builder can be created via
builder()
, ex:RetryPolicy.builder()
. RetryPolicy
andCircuitBreaker
can also be constructed with default values usingofDefaults()
.Fallback
andTimeout
offer additional factory methods for creating a a policy with only their required arguments, without using a builder, ex:Timeout.of(Duration.ofSeconds(10))
. Optional arguments must be specified through a builder, ex:Timeout.builder(duration).withInterrupt().build()
.- Policy configuration is now accessible via a
policy.getConfig()
.
- A policy builder can be created via
RetryPolicy and CircuitBreaker
- In
RetryPolicyBuilder
andCircuitBreakerBuilder
:withDelay
has been renamed towithDelayFn
.withDelayOn
has been renamed towithDelayFnOn
.withDelayWhen
has been renamed towithDelayFnWhen
.- The above method signatures have also been changed to accept a
ContextualSupplier
instead of aDelayFunction
, since it provides access to the same information.
CircuitBreaker
onOpen
,onClose
, andonHalfOpen
methods now accept aCircuitBreakerStateChangedEvent
argument.- 🚚
allowsExecution()
was removed in favor ofacquirePermit()
andtryAcquirePermit()
, which are meant for standalone CircuitBreaker usage.
Fallback
- 🚚 The
Fallback
async factory methods have been removed in favor of aFallbackBuilder.withAsync()
option.
⏱ Timeout
- ⏱
Timeout.withInterrupt(boolean)
is nowTimeoutBuilder.withInterrupt()
.
Execution and AsyncExecution
- The standalone
Execution
API, and theAsyncExecution
API created via theFailsafeExecutor.runAsyncExecution
andgetAsyncExecution
methods, have been unified to include:record(R, Throwable)
recordResult(R)
recordException(Throwable)
complete()
- 🚚 The previously supported
Execution
andAsyncExecution
methods for recording a result have been removed. The methods for performing a retry have also been removed. ForExecution
,isComplete
will indicate whether the execution is complete else if retries can be performed. ForAsyncExecution
retries will automatically be performed, if possible, immediately after a result or failure is recorded. - The
Execution
constructor is no longer visible.Execution
instances must now be constructed viaExecution.of(policies)
. Execution.getWaitTime()
was renamed togetDelay()
.
Failsafe class
- 🚚
Failsafe.with(P[] policies)
was removed in favor ofFailsafe.with(P, P...)
. This should only affect users who were explicitly passing an array toFailsafe.with
.
SPI Changes
⏱ The following changes effect the SPI classes, for users who are extending Failsafe with custom schedulers or policies:
- ⏱
Scheduler
andDefauledScheduledFuture
were moved to thespi
package. - 📦
Policy
andPolicyExecutor
were moved to thespi
package and some method signatures changed. - 📦
ExecutionResult
was moved to thespi
package and made generic. - 📦 Several new classes were added to the
spi
package to contain internal execution APIs includingExecutionInternal
,SyncExecutionInternal
, andAsyncExecutionInternal
. - 📦
FailsafeFuture
was moved to the SPI package and some method signatures changed.
🐛 Bug Fixes
- 👌 Improved the reliability of async executions, cancellations, and Timeouts.
👌 Improvements
- 🏗 Issue #47 - All policies and policy config classes are now threadsafe. Policy builders are not threadsafe.
- 🏗 Issue #201 - Thread safety is clearly documented in policy, policy config, and policy builder classes.
- Issue #292 - Created an extensible Policy SPI.
- Issue #254 - Added an explicit
compose
method toFailsafeExecutor
. - Issue #293 - Added
RetryPolicyBuilder.withBackoff(Duration, Duration)
and.withDelay(Duration, Duration)
. - ⏱ Issue #221 -
Executor
instances configured viaFailsafeExecutor.with(Executor)
are now used on all executions, including sync executions, and can be used in conjunction with a separately configuredExecutorService
orScheduler
for async executions. - ➕ Added
FailsafeExecutor.getPolicies()
. - ➕ Added
isFirstAttempt()
andisRetry()
toExecutionAttempt
, which is available via a few event listeners.
- ⚡️ The maven group id for Failsafe has changed to