KEMBAR78
Release v3.5.0 Β· reactor/reactor-core Β· GitHub
Skip to content

v3.5.0

Choose a tag to compare

@violetagg violetagg released this 10 Nov 15:26
· 1178 commits to main since this release

Reactor-Core 3.5.0 is part of 2022.0.0 Release Train.

This is the first GA release of 2022.0.0 πŸŽ‰

This note focuses on 3.5.0 proper, curating changes from across all milestones and also includes changes already released as part of 3.4.x line up to 3.4.25.

While there are plenty of improvements and bug fixes, it's worth to highlight the bigger themes first:

  • The Mono stack is now more lazy and complies to the Reactive Streams specification by only evaluating the source Publisher after receiving appropriate demand. Previously this usually happened during subscription time.
  • We reworked the metrics utilities. Please consult the reference documentation for more details.
  • A new context-propagation library has become an important part of the Reactor and Micrometer backbone to allow bridging between reactive and ThreadLocal contextual metadata. Reactor supports this bridging as soon as context-propagation library is present at runtime. Read more in the reference documentation.

Please pay special attention to the following update considerations. More detailed listing of features, bug fixes, and improvements follow.

⚠️ Update considerations and deprecations

⚠️ πŸ—‘οΈ Removals

  • Remove Kotlin extensions by @simonbasle in #2949
  • Remove deprecated Mono.doOn/AfterSuccessOrError by @simonbasle in #2954
    • The doOn* recommended alternatives include doOnNext(Consumer), doOnError(Consumer), doOnTerminate(Runnable), and doOnSuccess(Consumer),
    • The doAfter* recommended alternatives are doAfterTerminate(Runnable) and doFinally(Consumer).
  • Remove deprecated context-related operators by @simonbasle in #2953
    • deferWithContext(Function) -> use deferContextual(Function) instead,
    • subscriberContext(Context) and subscriberContext(Function) -> use contextWrite(ContextView) and contextWrite(Function) instead,
    • Signal::getContext() -> use Signal::getContextView() instead,
    • Context::putAll(Context) -> use Context::putAll(ContextView) instead.
  • Remove deprecated ElasticScheduler by @simonbasle in #2955
    • Use BoundedElasticScheduler (Schedulers.boundedElastic()) instead.

⚠️ βŒ› Deprecations

  • Introduce new module reactor-core-micrometer by @simonbasle in #3015
    • We introduced a new module, reactor-core-micrometer, and added operators and features supporting the new Observation API of Micrometer 1.10.0, read more about it the release notes.
    • The class reactor.util.Metrics, Flux::metrics() and Mono::metrics() operators have been deprecated.
  • Deprecate [Flux|Mono|Synchronous]Sink currentContext by @simonbasle in #2974, #3021
    • contextView() should be used instead.
  • Deprecate scheduler start by @chemicL in #3236
    • Scheduler#init() method should be used instead. Restart capability is discouraged and the new method is allowed to throw in case of initializing a disposed instance. Please create a new Scheduler instance when necessary.
    • Implementors of Scheduler should also implement the init() method, which currently delegates to start() in the default implementation.

⚠️ ♻️ Behavior Changes

  • Make some Mono sources and aggregators lazier by @OlegDokuka in #3081
  • Change behavior of switchOnNext/switchMap default 0 prefetch by @simonbasle in #2956
  • Have concatMap default to 0 prefetch behavior by @simonbasle in #2967
  • take(n) now behaves as take(n,true)/limitRequest by @simonbasle in #2969
  • SourceException wrapper for main stream errors delivered to windows by @chemicL in #3167
  • Scheduler.isDisposed() only true for disposed instances by @chemicL in #3243
  • adds cancellation of the source future support by @OlegDokuka in #3146
  • Scannable.tags() rework, add tagsDeduplicated() by @simonbasle in #3037
  • Disable fusion in MonoSubscriber by @UgiR in #3245
    • A number of Mono operators derived from the Operators.MonoSubscriber have stopped negotiating fusion (even though their Publisher still implements Fuseable)
    • The highest impact is likely to be on tests that validate the fusion negotiation (eg. StepVerifier's expectFusion(...))

✨ New features and improvements

Context propagation and bridging to ThreadLocals

Observability and logging

Operators and relevant machinery

  • Add 'tap', a generic side-effect/observability operator by @simonbasle in #3013
  • Add Flux.mergePriority, does not wait for all sources to emit by @osi in #3267
  • Introduce an alternative to Processor-with-upstream case by @simonbasle in #3042, #3065
  • Implement variant of windowTimeout with fairBackpressure by @OlegDokuka in #3054
  • Add windowTimeout sendNext early guard against maxSize overflow by @OlegDokuka in #3073
  • Replay terminal signals to late subscribers in Flux.replay(int) and Flux.cache(int) by @chemicL in #3200
  • Add disposeGracefully method to Scheduler by @chemicL in #3089
  • Optimize Scheduler initialization by @chemicL in #3248
  • Limit the number of Scheduler#disposeGracefully threads by @simonbasle in #3259
  • Add key hook parts to Schedulers.onHandleError by @simonbasle in #3039
  • Use byte padding to avoid fields re-ordering on JDK 15 and above by @lantalex in #3168
  • Make use of CompletionStage#handle instead of whenComplete by @He-Pin in #3221
  • adds on discard support for FluxZip/MonoZip by @OlegDokuka in #3209
  • Include classname of null-returning map function in NPE msg by @ismailalammar in #2984

reactor-test module

  • [reactor-test] Add StepVerifier option to use ConditionalSubscriber by @simonbasle in #3035
  • Implement disposing of tasks scheduled on VirtualTimeScheduler by @mdindoffer in #3097
  • Ensure StepVerifier evaluates signal that exits thenConsumeWhile by @simonbasle in #3203
  • Improve LoggerUtils support and add TestLoggerExtension by @simonbasle in #3123

🐞 Bug fixes

πŸ“– Documentation, Tests and Build

πŸ†™ Dependency Upgrades

New Contributors

Full Changelog: v3.4.16...v3.5.0