6,705 questions
0
votes
0
answers
7
views
Reactive Streams stop almost immediately when an ALB is in the mix
I have a spring boot flux endpoint (it takes and returns a flux). If there is no ALB in between, the client requests breeze through with no problems. Streams are closed gracefully on both ends no ...
-3
votes
0
answers
54
views
OpenTelemetry + ReactiveFeign + Spring WebFlux not propagating traceparent between microservices (header injected but missing in downstream service)
I’m running two Java microservices (A → B) in a Kubernetes cluster (GKE), using:
Spring Boot 3.5 (WebFlux)
ReactiveFeign (Playtika Feign Reactor 4.2.1)
OpenTelemetry Java Agent (2.20.1)
OTLP ...
1
vote
1
answer
73
views
Downloading a large file in spring MVC through Web client
I'm trying to download a large file with with Spring web client without loading an entire file to the memory. I have such service method:
@Override
public StreamingResponseBody download() {
Flux&...
0
votes
0
answers
35
views
Performance overhead of Mono.just() in Project Reactor [closed]
In the code written with Project Reactor/Webflux I have seen several times the code structures similar to this:
Mono<Void> method(someVariable) {
return Mono.just(someVariable)
....
Best practices
0
votes
1
replies
54
views
Wrap function result in Mono.defer
In which cases does it make sense to wrap the result of a function that returns a Mono in Mono.defer, when assigning it to a variable and using it later?
F.e.
fun getMono(): Mono<Int> // some ...
0
votes
0
answers
41
views
Why use FluxSink API in Project Reactor instead of directly managing subscriptions?
In Project Reactor, why did the designers choose to use the FluxSink API for emitting data instead of exposing a getSubscription() method, where you could directly call the request() and cancel() ...
0
votes
0
answers
27
views
How to use a reactive @ControllerAdvice in Spring Boot Webflux to return a custom error DTO for JSON but still render the HTML error page?
I’m working on a Spring Boot webflux application and trying to configure a global exception handler using @ControllerAdvice.
My goal is:
For REST (JSON) requests → return my own custom error DTO ...
0
votes
0
answers
24
views
Webflux concurrent modification exception in request builder
I found some random Concurrent modification exception in spring webflux please check followed stack trace:
java.util.ConcurrentModificationException
at java.base/java.util.HashMap.computeIfAbsent(...
0
votes
1
answer
117
views
SpringBoot Reactive (Webclient) - TraceId not propagated to reactor?
I'm working on a Spring Boot application using Spring WebFlux with reactive WebClient and Micrometer for tracing. While tracing works correctly in the imperative (servlet) stack, the trace context (...
1
vote
0
answers
66
views
How to run CacheRequestBodyGatewayFilterFactory before Spring Security filters in Spring Cloud Gateway?
Body
I’m working on a Spring Cloud Gateway project with Spring Security enabled.
I want to cache the request body using the existing CacheRequestBodyGatewayFilterFactory so that the body is available ...
0
votes
0
answers
97
views
Spring Webflux, authenticationSuccessHandler not invoked in oAuth2 login flow
I am still a beginner in Webflux. I want to get the user logged in using google and once the user is authenticated, I want to create my custom JWT (which has some role info specific to my app) and ...
2
votes
1
answer
145
views
How to read this marble diagram?
I have already gone through https://projectreactor.io/docs/core/release/reference/apdx-howtoReadMarbles.html.
But I cant seem to understand, how this would map to here. Where does subscribe, ...
0
votes
1
answer
504
views
Spring AI MCP Client not interacting with MCP Server
I'm trying to implement a simple MCP Server and Client. MCP Server just has a single function to create a file
Server Implementation
@Slf4j
@Service
public class FileSystemService {
...
1
vote
2
answers
62
views
weblux with retry and circuitBreaker return premature response or error response
api-gateway auth request interceptor. That will retry or return default response based on response and response status also modifies response and sends back to client
@Configuration
class ...
2
votes
1
answer
117
views
Why does Spring WebFlux use CharSequenceEncoder instead of KotlinSerializationJsonEncoder when returning a Kotlin data class?
I'm building a Spring WebFlux API with Kotlin and using Kotlinx Serialization for JSON serialization.
build.gradle.kts
plugins {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin....
0
votes
0
answers
38
views
Missing MDCContext from kotlin web flux
I have a spring web flux based application, written in kotlin I am adding few information in reactor context by using web filter. I also have logging information which I set in MDCContext but I am ...
2
votes
1
answer
68
views
Is there an auto-increment feature or approach for Spring Boot MongoDB entities in a reactive save API?
I have a Spring Boot microservice that provides non-blocking APIs for creating and managing entities called Product. The services uses a MongoDB. For design purposes, each Product needs to have a ...
1
vote
0
answers
59
views
project reactor, spring webflux and publishing async events
so I'm always quite confused when it comes to Flux objects and everything related to them.
In my usecase I have a reactive endpoint exposed to webclient which I want to publish async elements received ...
0
votes
0
answers
74
views
Unable to fetch response from a Springboot API using WebClient but works well when using RestTemplate called from Spring App
There is an existing API developed using SpringBoot and Java 21 and it works fine when the consumer is also Java 21. I had to switch the API to Java 8 and hence also downgraded SpringBoot version(2.3....
0
votes
0
answers
25
views
When using WebFluxLinkBuilder LocalDate is not encoded correctly
I'm trying to migrate a project of mine to WebFlux from MVC and I'm having an issue when encoding links using the WebFluxLinkBuilder to a method that take in a LocalDate, the link shows the data as &...
0
votes
0
answers
11
views
Cannot access web resources using spring reactive RouterFunction.resources() method
The following (simplified) code is deployed as a service.
@Configuration
public class RouterConfig {
private static String htmlContent;
static {
try {
InputStream res = ...
0
votes
0
answers
177
views
io.netty.channel.unix.Errors$NativeIoException: Connection reset by peer in Spring Cloud Gateway with WebFlux routing to GraphQL backend in Kubernetes
I'm experiencing a Connection reset by peer exception in my Spring Boot 3.4.4 application that uses Spring Cloud Gateway with WebFlux to serve a web application. The entire stack is deployed in a ...
0
votes
0
answers
38
views
Does JPA repository + withContext with runBlocking can still cause thread starvation?
I'm recently studying webflux and first I choose JPA.
And IDE says Blocking call in non-blocking context could possibly lead to thread starvation. So I changed code like below.
fun saveChatMessage(...
1
vote
1
answer
173
views
How to use Spring Security in a mixed mvc and webflux app
I have a Spring mvc app with working spring security configuration.
I have a single method that it use WebFlux and require security.
How can i use Spring security inside that method ?
It seams not ...
1
vote
2
answers
89
views
how to return Flux<T> as ResponseEntity in Spring Web Flux
I am unable to return Flux<T> in ResponseEntity. In my repository I return Flux<Student>. Now I want to handle this response in controller with switchIfEmpty to handle 404 error code using ...