Occurrent 0.16.11 is released with the following changes:
- Removed
isFinalErrormethod fromErrorInfoused byRetryStrategy, useisLastAttempt()instead. - Added
RetryInfoas argument to theexecextension function inRetryStrategy. - Added
retryAttemptExceptionas an extension property toorg.occurrent.retry.AfterRetryInfoso that you don’t need to use thegetFailedRetryAttemptExceptionmethod that returns anOptionalin the Java interface. Instead, theretryAttemptExceptionfunction returns aThrowable?. Import the extension property from theorg.occurrent.retry.AfterRetryInfoExtensionsfile. - Added
nextBackoffas an extension property toorg.occurrent.retry.ErrorInfoso that you don’t need to use thegetBackoffBeforeNextRetryAttemptmethod that returns anOptionalin the Java interface. Instead, thenextBackofffunction returns aDuration?. Import the extension property from theorg.occurrent.retry.ErrorInfoExtensionsfile. - In the previous version, in the retry strategy module,
onBeforeRetry,onAfterRetry,onErroretc, accepted aBiConsumer<Throwable, RetryInfo>. The arguments have now been reversed, so the types of the BiConsumer is nowBiConsumer<RetryInfo, Throwable>. - Added
onRetryableErrormethod toRetryStrategywhich you can use to listen to errors that are retryable (i.e. matching the retry predicate). This is a convenience method foronErrorwhenisRetryableis true. -
Added Kotlin extensions to
JacksonCloudEventConverter. You can import the functionorg.occurrent.application.converter.jackson.jacksonCloudEventConverterand 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.WriteConditonhas been converted to a java record. - Removed the deprecated method “getStreamVersion” in
org.occurrent.eventstore.api.WriteConditon, usenewStreamVersion()instead.