Skip to content

Occurrent 0.16.4 released

· All news

Occurrent 0.16.4 is released with the following changes:

  • Added a kotlin extension function that makes it easier to execute a RetryStrategy with a “Supplier”.

    The reasons for this is that when just doing this from kotlin:

    val string = retryStrategy.execute { "hello" }

    This will return Unit and not the “hello” string that you would expect. This is because execute in the example above delegates to org.occurrent.retry.RetryStrategy.execute(java.lang.Runnable) and not org.occurrent.retry.RetryStrategy.execute(java.util.function.Supplier) which one would expect. Thus, you can use this function instead to avoid specifying the Supplier SAM explicitly.

    I.e. instead of doing:

    val string : String = retryStrategy.execute(Supplier { "hello" })

    you can do:

    val string : String = retryStrategy.exec { "hello" }

    after having imported org.occurrent.retry.exec.

  • Kotlin jvm target is set to 17

  • Added ability to map errors with RetryStrategy, either by doing:

    retryStrategy
    .mapError(IllegalArgumentException.class, IllegalStateException::new)
    .maxAttempts(2)
    .execute(() -> {
    throw new IllegalArgumentException("expected");
    }));

    In the end, an IllegalStateException will be thrown. You can also do like this:

    retryStrategy
    .mapError(t -> {
    if (t instanceof IllegalArgumentException iae) {
    return new IllegalStateException(iae.getMessage());
    } else {
    return t;
    }
    })
    .maxAttempts(2)
    .execute(() -> {
    throw new IllegalArgumentException("expected");
    }));
  • Added a new execute Kotlin extension function to the ApplicationService that allows one to use a java.util.UUID as a streamId when working with lists of events (as opposed to Sequence).

  • Upgraded xstream from 1.4.19 to 1.4.20

  • Added better logging to org.occurrent.subscription.mongodb.spring.blocking.SpringMongoSubscriptionModel, including some debug logs that can be used for detailed information about what’s going on.

  • Upgraded Kotlin from 1.8.21 to 1.9.0

  • Upgraded Spring Boot from 3.0.6 to 3.0.7

  • Upgraded Spring Aspects from 6.0.9 to 6.0.10