Questions tagged [project-reactor]
Reactor is a foundational library building for reactive fast data applications on the JVM. It provides abstractions for Java, Groovy and other JVM languages to make building event and data-driven applications easier. It’s also really fast.
project-reactor
3,338
questions
2
votes
1
answer
49
views
Understanding execution order with .then(Mono{})
I'm trying to understand the behaviour of .then(Mono(x)) in spring webflux.
I have the following code:
fun storeIfValid(x): Mono<Long> =
doSomeChecksThatMightFail().then(repo.save(x))
...
1
vote
1
answer
16
views
Resilience4j and reactor RetryWhen not working together to distribuite 100 request at 10 requests per second
I'm calling a remote service and don't want to exceed 10 RPS, so I configured Resilience4j Rate Limiter and added retryWhen to handle RequestNotPermitted errors and retry when it is allowed.
The ...
1
vote
0
answers
49
views
Reactive Spring MessageSource
I am working on a WebFlux application with Reactor. I have an implementation of Spring MessageSource that in order to get an internationalized message, it calls to a database where the messages are ...
0
votes
0
answers
64
views
Reactor Context lost after thread switch (in flatMap or WebClient exchange function)
So we're having issues with Project Reactor's automatic context propagation (Hooks.enableAutomaticContextPropagation()). As soon as the reactive stream switches execution thread we're losing the ...
0
votes
0
answers
25
views
The Reactor "Context" can only be seen by operators above it
reading about Context in Reactor https://projectreactor.io/docs/core/release/reference/#context, in order to simulate the variables we used to set in ThreadLocal scope, Reactor has the concept of ...
0
votes
0
answers
9
views
Mono.timeout not working on Callable on blocking RestTemplate
I have this method:
private Mono<MyDTO[]> doRequest(List<Request> requests) {
return Flux.fromIterable(requests)
.map(Request::getParams)
.buffer(config.getBatchSize())
...
0
votes
0
answers
39
views
Context propagation using project reactor
I'm trying to leverage context propagation for MDC using project reactor. I've read the official docu and also went through a nice blog series https://spring.io/blog/2023/03/28/context-propagation-...
3
votes
0
answers
108
views
Moving from reactor 3.5 to 3.6 in Spring flux shows large increase in cpu due to context propagation. Can this be avoided?
When switching from reactor 3.5 to 3.6 we noticed a large increase in CPU usage.
Under same load (around 200 req per sec) the CPU usage doubles (~30% to ~60% avg with spikes to 100%).
Using profiling ...
1
vote
0
answers
78
views
Execute multiple Mono in parallel and combine results without blocking
I am writing a micro-service that calls for a few other microservices.
Some of the services that are being called are independent, while other services are dependent on the response of the previous ...
0
votes
0
answers
31
views
Finding matching value from one flux while iterating over another
Suppose I have 2 fluxes:
Flux<TypeA> typeAFlux = ...
Flux<TypeB> typeBFlux = ...
And I can join typeAFlux w/ typeBFlux via typeAFlux.fieldA = typeAFlux.fieldB. How would I go about that ...
-1
votes
1
answer
40
views
Flux groupBy and new traceId for every new portion of data
I want to implement reactive kafka consumer like that:
https://projectreactor.io/docs/kafka/release/reference/[6.8. Concurrent Processing with Partition-Based Ordering
][1]
Scheduler scheduler = ...
0
votes
0
answers
50
views
How can I have Reactor's Context work with Spring's cache?
So I have this particular use case where I'm combining the @Cacheable annotation with reactor and I want to access a value stored in the reactive context. Here is some sample code to reproduce the ...
0
votes
0
answers
32
views
Useful usecase to use limitRate method from Reactor
reading the documentation of limitRate method from Reactor https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Flux.html#limitRate-int- and testing with StepVerifier is not actually ...
-1
votes
0
answers
15
views
Flux delayElements function from Reactor are not expect as mine
below is my test code:
@Test
public void scan() throws InterruptedException {
List<Message> list = new LinkedList<>();
for (int i = 0; i < 10; i++) {
...
0
votes
1
answer
63
views
When to use ExecutorService-based vs. VirtualThread-based boundedElastic in Reactor?
I'm currently working on a project where I need to handle blocking network I/O operations efficiently without tying up essential system resources. I'm using Project Reactor and specifically the ...