Java / Micronaut Interview questions
How does Micronaut support reactive programming?
Micronaut's HTTP server and client are non-blocking and reactive by default, built on Netty's event-loop model, so controller and client methods can return reactive types instead of blocking the request thread.
@Get("/orders/{id}") public Mono<Order> get(String id) { return orderService.findAsync(id); }
Micronaut is reactive-library agnostic: it supports Project Reactor (Mono/Flux), RxJava 2/3, and Kotlin coroutines/Flow, converting between them internally as needed via its own reactive-streams-based context propagation layer.
This matters beyond syntax, because the server never blocks a thread waiting on I/O, a small, fixed-size event-loop thread pool can handle a much larger number of concurrent connections than a traditional one-thread-per-request blocking model, which is a major factor in Micronaut's low resource usage under load.
More Related questions...