Skip to content
Sharp

Reactive Streams · interview question

When using Project Reactor's Flux, which method can be used to handle a scenario where data production exceeds the subscriber's consumption rate?

Multiple choiceHardchapter-19-curatedpremiumreactive-streamsbackpressure-strategies
java
Flux.range(1, 10).onBackpressureBuffer(5);
Choose one answer
Answer and explanation

Correct answer

D. OnBackpressureBuffer

Why

The onBackpressureBuffer method buffers incoming data when the subscriber is slow, preventing data loss by storing the excess elements until they can be processed.

Test yourself on Reactive Streams

A free test with instant, explained results. No account needed.

Start free test
All Reactive Streams questions →