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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
14 views

@Valid not working spring boot 3.2 webflux

I tried to implement the Bean validation most of the tutorial show a simple configuration 1 dependencies <dependency> <groupId>org.springframework.boot</groupId> ...
cyril's user avatar
  • 912
-3 votes
0 answers
19 views

How do I handle exceptions when using a WebClient?

How do I handle exceptions in reactive operations, for example when using WebClient? In the following code snippet both report*() methods are marked with a breakpoint, but neither of those ever gets ...
Kodigas's user avatar
  • 49
0 votes
1 answer
22 views

Using Hibernate-Reactive and together R2DBC in one project

I am currently working on a project using Spring-Webflux and R2DBC. I am using an OracleDB 19c and corresponding drivers for R2DBC. Since Hibernate went reactive I want to try it in the existing ...
Titus's user avatar
  • 1
-1 votes
0 answers
13 views

How to debug Spring Boot Webflux application (Reactive code) Code in Intellij

I am new to spring-boot-webflux and reactive streams. I am running my project locally with IntelliJ (Ultimate Edition). I want to see, at a certain breakpoint, the values that a flux/mono can emit. ...
Harish Kumar Saini's user avatar
-2 votes
0 answers
44 views

authenticationManagerBuilder with webflux spring security

I have been facing problem to implement authenticationManagerBuilder with webflux spring security. It has been 2days still don't find any solution of it. Here how I implemented ...
Sakib X Hossain's user avatar
0 votes
0 answers
20 views

Custom json Converter to fail on unknown properties but the response is not json

I implemented a custom converter to fail on unknown properties. I have a Front connected to FirstBackend and FirstBackend connected to SecondBackend. i m on a springboot v2.7.14 this is my converter : ...
Fethi's user avatar
  • 1
0 votes
0 answers
14 views

Spring Doc Open API 3.0 with Spring Webflux

I am trying to access http://localhost:8080/swagger-ui/index.html. After login with credentials and I get the following error ***Whitelabel Error Page This application has no configured error view, so ...
Ash's user avatar
  • 1
0 votes
1 answer
22 views

Import custom jackson serializer (Module) in webflutest Springboot 3.2

I have an application in webflux and SpringBoot 3.2 i have custom Jackson Module and serializer, ubfortunately when i try to execute test no serializer found Custom module package ae.company.banking....
cyril's user avatar
  • 912
-1 votes
0 answers
18 views

Spring Webflux: CoRouter CoRouterFunctionDsl (Coroutine)-context not applied to onError

I am running web flux with Kotlin coroutines using spring boot 3.2 and the underlying version 6.1.1 of the spring framework. I am using micrometer for tracing. With spring's coRouter, I followed the ...
meberhard's user avatar
  • 1,805
-1 votes
0 answers
47 views

Write large amount of data in Java

I have a Spring WebFlux project which works with large amount of data. In my case I receive requests about 20000 requests per second. I have to write data without losing and blocking API endpoint. I ...
Nasibulloh Yandashev's user avatar
0 votes
0 answers
14 views

How do I replace the standard Thymeleaf Context with the reactive SpringWebFluxThymeleafRequestContext?

I have the following declarative code that uses Spring Boot 3: public String generatePage(String pageName, Map<String, ? extends Object> parameters) { ClassLoaderTemplateResolver ...
Alex Ionescu's user avatar
0 votes
0 answers
22 views

How to add Percentile in Spring WebFlux metrics

I am trying to add Percentile (like 0.95) into a webflux method and have it exported through /actuator/prometheus. @Service public class MyService { @Autowired MyClassRepository repository; ...
Bablu's user avatar
  • 171
0 votes
0 answers
46 views

springboot 3.1.6 webflux trace lost

I constructed the web client using the following method. @Bean public XXXApiService xxxApiClient(HttpClient httpClient, WebClient.Builder builder) { WebClient webClient = builder ...
李志博's user avatar
0 votes
1 answer
52 views

Deserializing a JSON Array response using Spring Webclient

I am having a problem deserializing this JSON array using Spring Webclient: [ { "id": "12345", "category": "Task", "status"...
Noouhh's user avatar
  • 1
0 votes
0 answers
23 views

Reactive SpringBoot Pageable [closed]

I was trying to implement Pageable in my RestController and running into issues with this error message "No primary or default constructor found for interface org.springframework.data.domain....
Ash's user avatar
  • 1
0 votes
1 answer
22 views

Spring boot Webclient metrics not exposing

I am using spring boot & spring webflux version 3.1.4 I have written the below code for Webclient. return WebClient.builder() .baseUrl(endpoint) .defaultHeader(&...
Prashant Aghara's user avatar
0 votes
1 answer
38 views

Invoke Kotlin suspended function inside reactive stream

I use Spring Boot app and Kotlin lang. I want to receive messages though the reactive Kafka consumer, and then pass these messages to the suspended Kotlin function and use coroutines there, then get ...
user2625402's user avatar
0 votes
0 answers
8 views

Rest api doc hal explorer with Spring webflux not working

I use Spring boot with webflux in aplication properties adding thos properties makes not working the Rest api doc explorer HAL or an other spring.main.web-application-type=reactive Tested with a demo ...
cyril's user avatar
  • 912
0 votes
0 answers
43 views

An error occurs when Spring Resource Server tries to parse a valid JWT. Invalid JSON: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $

I am trying to achieve content on resource server with WebFlux. I am sure, that my oauth2 authorization server works correctly and returns valid token. Request, that my resource server achieves: 2023-...
Mykhailo Ordyntsev's user avatar
0 votes
0 answers
20 views

How to implement search filter using queryDSL in reactive programming(R2DBC)

I am trying to create a search filter in a reactive application using spring boot webflux. What I am doing now is checking which search attributes are passed in the request and based on that preparing ...
JAVA_CAT's user avatar
  • 767
0 votes
0 answers
59 views

Spring Boot 3.x with Micrometer Tracing problems for spring-cloud-gateway

We are trying to upgrade our spring-cloud-gateway from Spring Boot 2.7.18 with Sleuth and Brave to 3.1.5. with Micrometer Tracing and Brave. So far so good. In Spring Boot (Webflux) prior 3 we could ...
Sandra Markerud's user avatar
0 votes
0 answers
23 views

Spring Webflux + Server-Sent Events keep Sink open for further connections

I want to distribute messages to several clients with Spring Webflux controller and a Server-Sent-Events endpoint. I use a Sink which receives the message on another endpoint and distributes them via ...
MarkusWb's user avatar
0 votes
1 answer
58 views

SpringSecurity using JWT

I am working on an application in Java, Spring, SpringBoot, Spring-Webflux. The application has a REST-interface where I want to autenticate the user using a provided JWT-token. Im not very good at ...
Jiinxy's user avatar
  • 569
0 votes
1 answer
38 views

Replacement for AwsSignerExecutionAttribute from software.amazon.awssdk.auth.signer?

I have logic that signs reactive ClientRequest requests from Spring WebFlux. import org.springframework.util.MultiValueMapAdapter import org.springframework.web.reactive.function.client.ClientRequest ...
pixel's user avatar
  • 25.2k
0 votes
1 answer
63 views

how to overcome blockOptional is blocking in spring web flux

I'm currently working on a streaming exercise, and here's the situation: I'm receiving a stream of tokens when I hit an endpoint, and my job is to save each of these tokens as they arrive. After the ...
James K J's user avatar
0 votes
0 answers
17 views

webflux bodyToMono code block not getting called

I am having following code, which is not being called, I tried it debugging it, but the code is not getting called in any way. private Mono<ServerResponse> validateRequestData(ServerRequest ...
Gaurav Sharma's user avatar
-1 votes
0 answers
53 views

Spring Boot Reactive : integration testing

I am working on a Spring Boot Reactive application. I am trying to do integration test: @Configuration class Config { @Bean ServiceImpl service(List<A> a) { return a ->...
ging's user avatar
  • 219
0 votes
1 answer
29 views

How to return a Mono using webTestClient in Spring WebFlux testing?

I have a Rest service in Spring WebFlux that returns a Mono<Person> from a /person/{id} endpoint. When I write my Junit test such as this it is expecting a Flux from the webTestClient as my code ...
Katlock's user avatar
  • 1,234
1 vote
1 answer
46 views

Spring boot WebFlux: WebFilter not working

I have the below controller which returns a Mono of string @RestController @RequestMapping("api/v1/test") public class TestController { @PostMapping public Mono<String> ...
Aymen Kanzari's user avatar
0 votes
0 answers
62 views

How to validate flux elements that are later buffered?

I have the following code which throws error and no flux elements is "processed" so printed on the screen: public class Test { public static void main(String[] args) { Flux.just(...
user3848246's user avatar
0 votes
1 answer
53 views

Java Reactor + Caffeine Caching + Mockito = Strict stubbing argument mismatch

I am using Java Reactor in a Spring-boot project, where I need to cache my data in one of the intermediate steps. It's on Spring Boot 3, Java 17, Junit5... My caching service looks like this: @...
Melih's user avatar
  • 704
0 votes
1 answer
40 views

Unable to access H2 console in spring-boot in reactive mode with Netty server

I am building a new Spring boot application with h2 db in WebFlux stack along with Netflix DGS. I want to access h2 DB console. I have used following configuration but I am not able to access my H2 DB ...
springbootlearner's user avatar
0 votes
0 answers
32 views

Project Reactor - Does Mono/Flux Zip method run code in parallel & how to handle Void return type?

I am trying to confirm 2 things. One, that zipping a collection of Monos or Fluxes will in fact run blocking-type calls such as hitting API endpoints, DB calls, or other network-related calls in a non-...
duppydodah's user avatar
0 votes
0 answers
25 views

reduce response time of an api call in springboot webflux project

i am working on a springboot project. i have an api which takes around 7-8 secs for response. i want to reduce it to less than a sec. please find below the code : CONTROLLER: @GetMapping("/agent/...
Ahmed Yusuf's user avatar
0 votes
0 answers
31 views

Webflux async requests showing up as different traceIds in datadog

We are using datadog in our webflux application, and the spans are showing as expected. However, they're not in 1 specific resource traceId, but rather broken down into different traceIds. I want to ...
worknovel's user avatar
2 votes
0 answers
86 views

Potential memory leak on Springboot 3.x + Webflux on multipart upload

Since I've upgraded my application from spring-boot 2.7 to 3.x (Im currently using 3.1.0), I'm experiencing a constantly memory usage increase of the memory used by the application when uploading ...
Bruno Dias's user avatar
0 votes
0 answers
17 views

reactive.result.method.annotation.RequestMappingHandlerMapping available: expected single matching bean but found 2: ,controllerEndpointHandlerMapping

this is the error: at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1271) at org.springframework.beans.factory.support....
user17713087's user avatar
0 votes
1 answer
29 views

Spring WebClient and JSON array with possible errors in its elements

I'm trying to fetch a JSON-array of length n and deserialize it to n objects of type RegistryPerson. This class is from an XSD and is immutable w.r.t. modification. One caveat is that the JSON-array ...
Ronny's user avatar
  • 51
1 vote
2 answers
59 views

The best way to pre-configure all instances of WebClient globally?

TL;DR - I am looking for the best way to provide all instances of WebClient in a single application some base configurations, like defining a timeout, by defining it in a single piece of code. I need ...
Bar Hoshen's user avatar
0 votes
0 answers
20 views

Spring sleuth bagage fields are not correctly set to MDC context

I am using Spring Sleuth version 3.1.9 along with Spring Webflux but when trying to get the MDC context of the bagagefields inside the logging it fails before I used a await from coroutines. But when ...
MrAndre's user avatar
  • 861
1 vote
2 answers
72 views

Difference between doOnComplete() and the third argument of subscribe() in Project Reactor

I’m currently working with Project Reactor and I’ve come across a scenario where I’m not sure whether to use doOnComplete() or the third argument of subscribe(). Both seem to be called when the ...
superpil's user avatar
0 votes
0 answers
20 views

Could not use javax.servlet.http.HttpServletRequest after excluding tomcat from spring boot web

My web service is implementing webclient from springboot webflux. In the meantime, it is also using javax.servlet.http.HttpServletRequestin some functions (see below). @GetMapping("/app-info&...
Zoey Long's user avatar
0 votes
0 answers
16 views

spring-session-data-mongodb reactive not cleanig up expired sessions

I'm trying to swap out using spring-session-data-redis for spring-session-data-mongo in a Webflux spring-cloud-gateway. Previously with the redis implementation session information in redis was ...
zargarf's user avatar
  • 633
0 votes
0 answers
44 views

Asynchronous Execution Issue with Reactive Programming in Java

I have a method (enrichData) that retrieves metadata for an ID from different sources (LocalCache, RedisCache, and ApiService) using Project Reactor's Mono in Java. The goal is to ensure that only one ...
Techie97's user avatar
0 votes
0 answers
39 views

How can I custom header with springdoc openapi

When I hit the execute button in swagger ui, the request header always has the accept-encoding header with value "gzip, deflate, br". I've added a custom header with name "accept-...
Nguyễn Hữu Quân's user avatar
0 votes
2 answers
42 views

switchIfEmpty executed when the prior flatMap returns Mono.error()

I have a spring gateway filter that has analogues code: public Mono<Something> example { return redisTemplate.opsForValue() .get(cacheKey) .flatMap(this::throwMono) ...
Saikiran's user avatar
  • 141
0 votes
0 answers
18 views

Persisting Application Version in Logs Across All Threads in Spring Boot 3.1.5 with WebFlux and SLF4J

I'm working on a Spring Boot 3.1.5 project that uses WebFlux and SLF4J for logging. My goal is to include the application version number in all log entries generated throughout the application. To ...
Jorge Garcia's user avatar
0 votes
0 answers
64 views

Async Response HTTP

We are making a service that should accept HTTP requests. This method should send client data to the Kafka “send” topic and forget about it for a little while (but not block) @GetMapping("/comp&...
Alexandr's user avatar
-1 votes
2 answers
57 views

How to resolve getting Timeout java.lang.IllegalStateException: Timeout on blocking read for 5000000000 NANOSECONDS

I want to write a async api that return 202 Accepted after getting a request. Then after that it should send n Post request per second for halt-time seconds. This is my attempt at the problem. @...
denisssj's user avatar
1 vote
0 answers
42 views

How to elegantly manage transactions in Spring WebFlux with traditional database frameworks?

How to elegantly manage transactions in Spring WebFlux with traditional blocking database framework frameworks, such as JDBC, JPA, and MyBatis? Some features of Spring Data R2DBC are not very good, so ...
zy_sun's user avatar
  • 195

1
2 3 4 5
124