Skip to content

v3.2.0.M2

Pre-release
Pre-release
Compare
Choose a tag to compare
@simonbasle simonbasle released this 13 Jun 12:10

MILESTONE 2 for Reactor 3.2.0, which will be the first release in the CALIFORNIUM Release Train.

This milestone contains a lot of fixes and improvements, as well as new features we'd really like your feedback on:

📢 Feedback Wanted! New features

  • Add metrics() to Flux (#1183, #1123, 34e0d4b)
    • This operator does nothing if Micrometer is not on the classpath
    • It exposes metrics from upstream signals visible at the operator's position in the chain
    • 📢 Feeback wanted on the type of metrics exposed
  • Add exponential backoff retry with jitter to core: retryWithBackoff (#1122)
    • This version of retry reflects what we think is the industry best practice in terms of retries.
    • It is a good middle ground between the too simple retry(n), the complex retryWhen(Function) and the more configurable RetryFunction from reactor-addons
  • New operators for transactional reactive use cases: usingWhen (#1220, b87ea6d)
    • Like using, but the resource is provided asynchronously through a Publisher
    • Can have separate async "cleanup" for complete, error and cancel terminations
    • Cleanups are asynchronous as well (Function<Resource, Publisher>) and only delay the propagation of the terminal signals, NOT the onNext signals.

⚠️ Update considerations and deprecations

  • windowUntil and windowWhile don't have a final empty window at the end of the sequence (#1033)
  • Default behavior for Operators.onErrorDropped is now to both bubble and throw the error
    • Mono.fromCompletionStage now drops fatal exceptions rather than hanging (#1118)
  • Blocking APIs (like blockLast(), block(), iterator()) called inside a parallel or single Scheduler trigger an exception (#1102)
    • This kind of blocking call are harmful as they impact limited resources, with a high risk of freezing the application
  • concatMapDelayError default behavior is now to delay the errors until the END (#1101)
    • This aligns with other *DelayError operators
  • StepVerifier.withVirtualTime now use a global lock, making virtual time verifications mutually exclusive (#648)
    • Virtual time impacts schedulers at the application level. Parallelisation of tests could lead to unforeseen side effects due to this (initializing operators with a VTS and have the StepVerifier see and manipulate the wrong VTS)
  • create uses Operators.onOperatorError hook instead of onErrorDropped (#1078)
  • (deprecation) Scannable#operatorName() is deprecated in favor of stepName() (#1115, #1140)
  • (internal) Switch to a simplified implementation for Mono.publish(Function) (#437)
  • (internal) Simplify MonoProcessor internals in preparation for #1114 and further 3.2 changes

✨ New features and improvements

  • cache(Duration) now have an overload that takes a Scheduler, added Mono.cache TTL-generator variant (#1189, #1125)
  • Operators.lift now has an alternative that exposes the raw Publisher: liftPublisher (#1205)
  • Operators.lift now supports Fuseable (#1206)
  • Added zip variants with 7 and 8 arguments (#1210
  • Support 0 delay/period in Flux.interval (#1178)
  • Add immutable empty()`` queue Supplier to Queues, support empty and one cases in Queues.capacity()` (#1161, d9d76ab)
  • doOnEach now support Fuseable and ConditionalSubscriber (#1003)
  • Flux.take(0) now eagerly cancels on subscription (#1158)
  • Lazy Mono#fromFuture and Mono#fromCompletionStage added, with Supplier param (#1131)
  • Add an `error(Supplier)`` variant to Flux and Mono (#1100)
  • Add Scannable#steps(), which produces a Stream<String> of all the stepNames both upstream and downstream (including the current Scannable) (#1115, #1140)
  • All operators now implement basic Scannable (this avoids problems for users that use instanceof checks in hooks, #1136)
  • [kotlin] Add Flux.split extension to convert Flux<List<T>> to Flux<T> (#1089)
  • [reactor-test] Add verifyThenAssertThat(Duration) to allow assertions and verification timeout (#1124)
  • [reactor-test] Allow naming of a whole StepVerifier scenario through options (#1077)
  • [reactor-test] Allow to change the LoggerFactory with a custom implementation, provide a TestLogger one that can be used to assert log contents (8f3a8fa)
  • [reactor-test] Add a cold version of the TestPublisher than can be set up before eg. subscribing in a StepVerifier (#1236)

🪲 Bug fixes

  • Flux.last() now correctly throws a NoSuchElementException on empty source even when said source is a Callable Mono(#1226)
  • delayUntil correctly request Long.MAX_VALUE and not Integer.MAX_VALUE on subscribe (#1214)
  • Operators.lift() properly maintain GroupedFlux/ConnectableFlux interfaces (#1204)
  • Request is now accounted for in `FluxOnBackpressureBufferTimeout (#1194)
  • onSubscribe should be done before add in MonoCacheTime.subscribe (#1190)
  • Multi-subscriber operators Context resolution resolves to 1st context (#1114)
  • Fix dangling thread when calling WorkQueueProcessor.forceShutdown (#1142)
  • Let VirtualTimeScheduler defer advanceTime if queue is empty (#783)
    • This avoids a situation where, due to a subscribeOn, the operators delaying values end up reading the clock AFTER the virtual time has been moved forward by thenAwait, hanging the test.
  • Tweak FluxPublish dispose to clear the existing connection (#1173)
  • Avoid interrupting WorkerTask Future if cancelled race (#1107)
  • FluxRefCount DisconnectException on cancellation race (#1088)
  • (internal cleanup) use passed queue in FluxGroupBy.checkTerminated (#1094)
  • Only terminate ExecutorScheduler if underlying is shut down (#1080)
  • Mono.fromCompletionStage now drops fatal exceptions rather than hanging (#1118)

📖 Documentation, Tests and Build

👍 Thanks to the following contributors that also participated to this release

@alex-diez, @baptistemesta, @charlesmuchene, @igoperikov, @madgnome, @OlegDokuka, @smiklos, @utwyko, @yamkazy