Occurrent 0.16.11 is released with the following changes:
- Removed
isFinalError
method fromErrorInfo
used byRetryStrategy
, useisLastAttempt()
instead. - Added
RetryInfo
as argument to theexec
extension function inRetryStrategy
. - Added
retryAttemptException
as an extension property toorg.occurrent.retry.AfterRetryInfo
so that you don’t need to use thegetFailedRetryAttemptException
method that returns anOptional
in the Java interface. Instead, theretryAttemptException
function returns aThrowable?
. Import the extension property from theorg.occurrent.retry.AfterRetryInfoExtensions
file. - Added
nextBackoff
as an extension property toorg.occurrent.retry.ErrorInfo
so that you don’t need to use thegetBackoffBeforeNextRetryAttempt
method that returns anOptional
in the Java interface. Instead, thenextBackoff
function returns aDuration?
. Import the extension property from theorg.occurrent.retry.ErrorInfoExtensions
file. - In the previous version, in the retry strategy module,
onBeforeRetry
,onAfterRetry
,onError
etc, accepted aBiConsumer<Throwable, RetryInfo>
. The arguments have now been reversed, so the types of the BiConsumer is nowBiConsumer<RetryInfo, Throwable>
. - Added
onRetryableError
method toRetryStrategy
which you can use to listen to errors that are retryable (i.e. matching the retry predicate). This is a convenience method foronError
whenisRetryable
is true. -
Added Kotlin extensions to
JacksonCloudEventConverter
. You can import the functionorg.occurrent.application.converter.jackson.jacksonCloudEventConverter
and use like this:val objectMapper = ObjectMapper() val cloudEventConverter: JacksonCloudEventConverter<MyEvent> = jacksonCloudEventConverter( objectMapper = objectMapper, cloudEventSource = URI.create("urn:myevents"), typeMapper = MyCloudEventTypeMapper() )
- Fixed problem with spring-boot autoconfiguration in which it previously failed to create a default cloud event converter if no type mapper was specified explicitly.
- Upgraded to Kotlin 1.9.20
- Added a “deleteAll” method to InMemoryEventStore which is useful for testing
- The
org.occurrent.eventstore.api.WriteConditon
has been converted to a java record. - Removed the deprecated method “getStreamVersion” in
org.occurrent.eventstore.api.WriteConditon
, usenewStreamVersion()
instead.