Occurrent 0.16.11 is released with the following changes:

  • Removed isFinalError method from ErrorInfo used by RetryStrategy, use isLastAttempt() instead.
  • Added RetryInfo as argument to the exec extension function in RetryStrategy.
  • Added retryAttemptException as an extension property to org.occurrent.retry.AfterRetryInfo so that you don’t need to use the getFailedRetryAttemptException method that returns an Optional in the Java interface. Instead, the retryAttemptException function returns a Throwable?. Import the extension property from the org.occurrent.retry.AfterRetryInfoExtensions file.
  • Added nextBackoff as an extension property to org.occurrent.retry.ErrorInfo so that you don’t need to use the getBackoffBeforeNextRetryAttempt method that returns an Optional in the Java interface. Instead, the nextBackoff function returns a Duration?. Import the extension property from the org.occurrent.retry.ErrorInfoExtensions file.
  • In the previous version, in the retry strategy module, onBeforeRetry, onAfterRetry, onError etc, accepted a BiConsumer<Throwable, RetryInfo>. The arguments have now been reversed, so the types of the BiConsumer is now BiConsumer<RetryInfo, Throwable>.
  • Added onRetryableError method to RetryStrategy which you can use to listen to errors that are retryable (i.e. matching the retry predicate). This is a convenience method for onError when isRetryable is true.
  • Added Kotlin extensions to JacksonCloudEventConverter. You can import the function org.occurrent.application.converter.jackson.jacksonCloudEventConverter and use like this:

     val objectMapper = ObjectMapper()
     val cloudEventConverter: JacksonCloudEventConverter<MyEvent> =
            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, use newStreamVersion() instead.