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
3 answers

Facing io.netty.handler.timeout.ReadTimeoutException: null while consuming server sent events

I am new to spring web flux, I have a client application that consumes server-sent events, The events are published by the server randomly there is not fixed delay. But consumer throws io.netty.handler.timeout.ReadTimeoutException: null after 60…
2
votes
0 answers

Handling token response in spring oauth2 client

I am using Spring Cloud Gateway as a API Gateway for our system. We would like to delegate all authentication (oauth) to that component. I was looking at the source code of Spring Oauth2 Client but I don't see any place where I can "plug in" to do…
2
votes
2 answers

R2DBC adjacency list get all children

I have a table which has id and parentId columns: i refer to this structure as an adjacency list. So, now i want to get all children of arbitrary id. Classic solution of this problem use recursion, for example here is Postgres procedure or CTE…
2
votes
1 answer

SpringData MongoDB @TypeAlias ceased to work after upgrade

I'm trying to solve project problems after upgrading from Spring Boot 2.3.1.RELEASE to Spring Boot 2.5.0 (doesn't work either for 2.4.0+) with @TypeAlias seem to be ignored. I use Kotlin and reactive manner to achieve this. I got set basePackages to…
2
votes
0 answers

ReadTimeoutException on ReactiveElasticsearchClient of Spring Data Elasticsearch

With the default ReactiveElasticsearchClient I am getting ReadTimeoutExceptions on loadtest with jmeter when trying to index a document. I´m indexing 1 document per user. 500 concurrent user. loop count 20. Elasticsearch cluster, the application and…
2
votes
1 answer

Webflux Stream Large List and Consume it using another springboot app

I have a large list call List object = [1000+ Records], So I have created one end point in spring boot @GetMapping("/path") public Flux streamAPI(){ List object = [1000+ Records] return…
2
votes
0 answers

Build a reactive API server messages from Kafka in server sent event manner with Spring webflux

I'm working on building a reactive web service that's connected to a Kafka topic, and it will support a reactive API that all requestor calling this API will receive new messages from Kafka as server sent events. (Originally thinking about the API…
2
votes
1 answer

How to convert a Flux> to a merged Flux?

While working with Project Reactor, there came a use case where I'd want to convert a Flux > to a > where all those lists are flattened to form a Flux. Is there any out of the box method for the same?
ayush prashar
  • 436
  • 5
  • 13
2
votes
1 answer

Why can't I use concatWith after Flux initiation

I'm newbie and I'm learning Spring Flux. I couldn't understand the Following: Watermelon is being printed here: Flux fruitFlux = Flux.just("Apple", "Banana", "Orange").concatWith(Flux.just("Watermelon")); fruitFlux.subscribe(…
Drawio
  • 45
  • 1
  • 6
2
votes
1 answer

webflux: internal event bus and async, loosley coupled event listeners

How can I implement an internal event bus to do async operations in a webflux spring stack? I want a service to emit an event: @Service class FeedServiceImpl(/*...dependencies...*/) : FeedService { override suspend fun deleteEntry(entryId: Long)…
Stuck
  • 11,225
  • 11
  • 59
  • 104
2
votes
0 answers

Asynchronous streaming with Spring MVC

Here's a part of a Spring Web MVC app using WebClient for its OAuth2 client integration, its purpose being to proxy some requests to and from the resource server with the appropriate authorization headers, hacked together to pipe data from an async…
2
votes
1 answer

Merging two Mono and getting a Flux. Then extracting a Mono from that Flux

I have two Mono that i have got from two different sources let us say KAFKA. My intention is to merge both these Mono into a Flux. 1 Then use public final Mono reduce(BiFunction aggregator) method in Flux to create a final Mono out…
nihar
  • 135
  • 1
  • 17
2
votes
1 answer

How to query a subselect with sorting and pageable in R2dbcRepository

I am using R2dbcRepository and I think it does not support native queries. @Query(nativeQuery is giving an error. I cannot seem to find a solution for the query without going native since I have join tables, subselect query, and Pageable. I cannot…
sophie
  • 991
  • 2
  • 15
  • 34
2
votes
1 answer

Java Stream Filter with a reactive predicate

I need to filter a collection using a reactive predicate. Something like this (obviously the real code is not so simple): private void filterElements(List elements) { // Flux.fromStream(elements.stream()) // maybe I have to make this? …
Alberthoven
  • 2,798
  • 1
  • 24
  • 29
2
votes
2 answers

Log inside Mono.error gets outputted twice

For some strange reason, the "User not found" log gets outputted twice in the logs of my application, despite calling findUserById only once. I am not sure what causes this problem. Is there a better way to approach this (logging and throwing an…