Skip to content
Sharp

Project Reactor · interview question

How can a Flux be created to simulate an infinite stream of data for testing purposes?

Multiple choiceMediumchapter-19-curatedpremiumproject-reactorproject-reactor-flux
Choose one answer
Answer and explanation

Correct answer

C. Using the generate() method with a Supplier.

Why

The generate() method can be used with a Supplier to simulate an infinite stream by continuously providing new elements, making it suitable for testing scenarios that require ongoing data streams.

Test yourself on Project Reactor

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

Start free test
All Project Reactor questions →