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

GH-2464: WebFlux: Get rid of Mono.block() #2465

Merged
merged 2 commits into from
Jun 11, 2018

Conversation

artembilan
Copy link
Member

Fixes #2464

The WebFluxInboundEndpoint resolves a Principal via Mono.block()
operation.
This is prohibited situation in the non-blocking thread, like Reactor
Netty

  • Defer Mono<Principal> resolution to the message header via
    deferring the whole Message creating via flatMap() operation on the
    main doHandle() Mono

Cherry-pick to 5.0.x

Fixes spring-projects#2464

The `WebFluxInboundEndpoint` resolves a `Principal` via `Mono.block()`
operation.
This is prohibited situation in the non-blocking thread, like Reactor
Netty

* Defer `Mono<Principal>` resolution to the message header via
deferring the whole `Message` creating via `flatMap()` operation on the
main `doHandle()` `Mono`

**Cherry-pick to 5.0.x**
@garyrussell
Copy link
Contributor

garyrussell commented Jun 1, 2018

Checkstyle errors

[ant:checkstyle] [ERROR] /Users/grussell/Development/spring-integration/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/dsl/WebFluxDslTests.java:26: Using a static member import should be avoided - org.springframework.web.reactive.function.client.ExchangeFilterFunctions.Credentials.basicAuthenticationCredentials. [AvoidStaticImport]
[ant:checkstyle] [ERROR] /Users/grussell/Development/spring-integration/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/dsl/WebFluxDslTests.java:27: Using a static member import should be avoided - org.springframework.web.reactive.function.client.ExchangeFilterFunctions.basicAuthentication. [AvoidStaticImport]

…c imports

* Add `defaultIfEmpty()`, when `exchange.getPrincipal()` is an empty `Mono`
@garyrussell garyrussell merged commit 0fc8bec into spring-projects:master Jun 11, 2018
garyrussell pushed a commit that referenced this pull request Jun 11, 2018
* GH-2464: WebFlux: Get rid of Mono.block()

Fixes #2464

The `WebFluxInboundEndpoint` resolves a `Principal` via `Mono.block()`
operation.
This is prohibited situation in the non-blocking thread, like Reactor
Netty

* Defer `Mono<Principal>` resolution to the message header via
deferring the whole `Message` creating via `flatMap()` operation on the
main `doHandle()` `Mono`

**Cherry-pick to 5.0.x**

* * Fix Checkstyle for the Reactive Spring Security testing utils static imports
* Add `defaultIfEmpty()`, when `exchange.getPrincipal()` is an empty `Mono`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding Spring security to WebFlux flow fails with blocking errors
2 participants