Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize uses of onErrorResume() #31352

Closed
wants to merge 1 commit into from

Conversation

kzander91
Copy link
Contributor

Replace uses of onErrorResume() with

  • onErrorMap() in places where it is just used to map to a different exception.
  • onErrorComplete() where it just maps to Mono.empty().
  • onErrorReturn() where it just maps to Mono.just().

The first change achieves the same using less code, while the latter two changes improve efficiency as of Reactor 3.4.23 (see reactor/reactor-core#3159) by avoiding the unnecessary creation of Mono/Flux instances.

This commit replaces uses of onErrorResume() with
- onErrorMap() in places where onErrorResume() is just used to map to a
  different exception.
- onErrorComplete() where onErrorResume() just maps to Mono.empty().
- onErrorReturn() where onErrorResum() just maps to Mono.just().
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 3, 2023
@bclozel bclozel self-assigned this Oct 3, 2023
@bclozel bclozel added type: enhancement A general enhancement in: data Issues in data modules (jdbc, orm, oxm, tx) in: web Issues in web modules (web, webmvc, webflux, websocket) and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 3, 2023
@bclozel bclozel added this to the 6.1.0-RC1 milestone Oct 3, 2023
@bclozel bclozel closed this in e8b42c5 Oct 3, 2023
@bclozel
Copy link
Member

bclozel commented Oct 3, 2023

Thanks @kzander91 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants