4,070 questions
0
votes
0
answers
43
views
Spring WebFlux .doOnSubscribe & .doFinally. Is this race condition possible, if so, how to fix it?
I am using WebFlux Sinks to send SSE events to players.
When player first obtains the connection .subscribe(Long playerId) and consequently .configure(Subscription sub) are called.
Here is my code ...
2
votes
1
answer
133
views
Why should I return a Publisher instead of throwing an exception in Spring WebFlux?
In Spring WebFlux, when working with reactive streams , why is it recommended to return a Publisher (like Mono.error()) instead of throwing an exception directly within a stream?
I saw this question ...
0
votes
0
answers
92
views
Execute blocking task after webflux rest service response is delivered
I want to implement a Rest Service which will return response immediately and continue processing blocking tasks only after response is delivered.
The objectives are
Run blocking & long running ...
2
votes
1
answer
121
views
spring webflux does not catch exception
I’m trying to catch a thrown exception in a Spring WebFlux controller. When i[0] reaches 3, it enters the handler method and executes the handler, but the returned value is not shown in the output, ...
Advice
0
votes
1
replies
54
views
Why doesn't R2DBC support features like lazy loading, cascading operations, or dirty checking, which are available in JPA?
I'm working with Spring Data R2DBC in a reactive application and noticed that it doesn't support features like lazy loading, cascading operations, or dirty checking, which are commonly found in JPA ...
0
votes
2
answers
85
views
Why doesn't Spring Data R2DBC support Jpa features? [closed]
I'm working with Spring Data R2DBC and am curious about why it doesn't support features like lazy loading, cascading operations, or dirty checking, which are commonly used in JPA.
Could someone ...
2
votes
0
answers
117
views
Return type mismatch: expected 'Any', actual 'Authentication?'
I tried to upgrade my codes to Spring Boot 4.0.0, and given the following Kotlin codes,
@Bean
fun auditorAware(): ReactiveAuditorAware<String> = ReactiveAuditorAware<String> {
...
Advice
0
votes
2
replies
63
views
why java stream api is one time use but reactor's publisher not?
why can we subscribe as may as we want from reactor publisher but just one time from java stream api?What reason is there for stream to be one time use?
2
votes
1
answer
101
views
How to find the root cause / exception stacktrace of signal type CANCEL
In doFinally have printed the signal type to finally verify that it was a cancellation (CANCEL). However, this is not captured as part of doOnError as technically cancellation is not part of error.
...
Best practices
0
votes
1
replies
59
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 ...
1
vote
1
answer
108
views
Measure elapsed time on Spring reactor
I am using spring-webflux version 3.2.x
I want to log the total elapsed time of an whole pipeline execution.
I have found a method elapsed() but I want the total time, but I want the total time, not ...
1
vote
1
answer
430
views
Spring MCP Client do not access to HTTP Headers from McpTransportContext in stream mode
I'm trying to implement a Spring MCP Client based on the spring-ai 1.1.0-SNAPSHOT library.
The minimal project source code is available in this public GitHub repository: https://github.com/robynico/...
0
votes
0
answers
104
views
Spring Kafka 3.3 reactive @KafkaListener commits offset immediately on error — DefaultErrorHandler not retrying
I’m using Spring Kafka 3.3.10 with a reactive Kafka listener (returning Mono).
My listener processes a message, calls a downstream WebClient, aggregates results, and returns a Mono.
If a timeout ...
0
votes
1
answer
57
views
What is the equivalent to doOnComplete for mono
At some point in our code using rxjava we have
public Maybe<Event> verifyFoo(Event event){
return Maybe.just(event)
.flatMap(this::foo)
.doOnComplete(() -> ...
1
vote
1
answer
47
views
Process events with throttling and timeout
There are different kinds of events in my application. Let's call them for simplicity a-event, b-events, c-events and so on. I need to implement throttling for each kind of events separately:
@...