Questions tagged [spring-webflux]

Spring Framework 5 includes a new spring-webflux module. The module contains support for reactive HTTP and WebSocket clients as well as for reactive server web applications including REST, HTML browser, and WebSocket style interactions. WebFlux can run on Servlet containers with support for the Servlet 3.1 non-blocking I/O API as well as on other async runtimes such as Netty and Undertow.

Questions tagged spring-webflux should be about applications using the Spring WebFlux framework.

If Spring Boot is involved, please also tag the question with spring-boot. If the question is related to the use of Reactor operators, please tag the question with project-reactor as well.

For Spring WebFlux related documentation, please refer to the:

6050 questions
2
votes
0 answers

How to add multiple client credentials on spring boot webclient using webflux

Currently my setup as following. @Configuration public class Oauth2WebClientConfig { private final Environment env; @Autowired public Oauth2WebClientConfig(Environment env) { this.env = env; } // == Oauth2…
2
votes
1 answer

Cannot read Part's content (Flux) into a single String

In the following snippet, I'm trying to extract a file's content (sent to a given service) using Spring's Part object and convert it into a String. The issue is that it skips the mapper function and the code inside the mapper function doesn't…
sharon182
  • 533
  • 1
  • 4
  • 19
2
votes
1 answer

How can I make Mono Void get returned in another Mono Void?

Mono my_function(final String reviewObject){ return Mono.fromCallable( () -> { ReviewDto reviewDto = new ReviewDto(); try { objectMapper.updateValue(reviewDto,…
Abdulmalik
  • 33
  • 1
  • 2
  • 6
2
votes
2 answers

Specify server request timeout in Spring Boot & Spring WebFlux (Netty)

We are using Spring Boot in 2.4.2 with Spring WebFlux. I want the Spring Boot application to terminate all requests to the application that take longer than say 3 seconds to process. There is server.netty.connection-timeout, but that doesn't seem to…
Harold L. Brown
  • 8,423
  • 11
  • 57
  • 109
2
votes
1 answer

What is the best way to make a non-blocking HTTP request using Reactor WebClient and deserialize the response to an object?

I have experience with asynchronous libraries like Vert.x but new to Reactor/WebFlux specifically. I want to expose a single endpoint on a web application that when hit, turns around and calls another web service, parses the response into a Java…
2
votes
1 answer

Spring Webflux - WebClient: How to get a List nested inside a larger Response directly?

Small question regarding Spring Webflux, and how to get the nested List of Pojo that is present in a http response directly. We are consuming an API which response is something like { "noNeedThisField": "I do not need this", …
PatPanda
  • 3,644
  • 9
  • 58
  • 154
2
votes
1 answer

onErrorMap with onErrorContinue

I am learning about error handling using Flux/Mono and have this problem: Flux.just("AAA", "BBB", "AAA", "CCC") .map(s -> { if (s.equals("AAA")) { throw new IllegalArgumentException(); } return s; }) …
ByeBye
  • 6,650
  • 5
  • 30
  • 63
2
votes
1 answer

Spring Boot - Custom JsonDeserializer is ignored

I am trying to apply a custom Jackson deserializer (class "com.fasterxml.jackson.databind.JsonDeserializer") to a bean from a third-party library that requires custom deserialization. My custom deserializer is written in Kotlin: @JsonComponent class…
2
votes
0 answers

How to keep thread safe with multiple pods of a Spring Data Reactive Repository microservice

I have a microservice to wrap the access to a MongoDB (DaaS). It is implemented with Spring Data Reactive Repository (ReactiveMongoRepository). I have deployed within a docker image, running on Kubernetes (in Google Cloud). I have configured the…
Alberthoven
  • 2,798
  • 1
  • 24
  • 29
2
votes
1 answer

Webflux + Webclient + Netty, how to use SslContext with multiple client certificates please?

Small question regarding Netty, Spring Webflux, and how to send http requests to multiples downstream systems, when each of the downstream require mTLS and a different client certificate is required to send requests to each please? What I have so…
PatPanda
  • 3,644
  • 9
  • 58
  • 154
2
votes
1 answer

MultiTenancy with ReactiveCrudRepository

I have a Spring boot webflux application. Its a SAAS application and there will be multiple organization and multiple users from each organization. So, I store org_id in each table and apply where org_id=? in each select, update and delete…
2
votes
1 answer

Execute the current flow while background process is running - mono reactive programming

I am trying to run the main method where the main method calls another method(Bmethod) which I need to run in the background but I need the main method response immediately without waiting for Bmethod response. I need to use java reactive…
sudar
  • 1,446
  • 2
  • 14
  • 26
2
votes
1 answer

Concurrency > 1 is not supported by reactive consumer, given that project reactor maintains its own concurrency mechanism

I'm migrating to the new spring cloud stream version. Spring Cloud Stream 3.1.0 And I have the following consumer configuration: someChannel-in-0: destination: Response1 group: response-channel consumer: concurrency: 4 …
2
votes
0 answers

io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate

Small question regarding an issue faced when mTLS is enabled. On a Java + Spring Webflux project for both client and server, the client is configured to send requests as such: public SslContext getSslContext() { try { final…
PatPanda
  • 3,644
  • 9
  • 58
  • 154
2
votes
2 answers

How do I debug a Mono that never completes

I have a Spring Boot application which contains a complex reactive flow (it involves MongoDB and RabbitMQ operations). Most of the time it works, but... Some of the methods return a Mono. This is a typical pattern, in multiple layers: fun…
egbokul
  • 3,944
  • 7
  • 36
  • 54