Java / Micronaut Interview questions
Explain the execution flow of an HTTP request in Micronaut?
An incoming HTTP request flows through several stages before a response is written back, all on Micronaut's non-blocking Netty pipeline.
Netty decodes the raw bytes into an HTTP request object on an event-loop thread. The router, built from compile-time route metadata, matches the request's path and method to a controller method, with no reflection involved in this match. Any registered HttpServerFilter beans run before and after the controller, commonly used for things like authentication, logging, or CORS.
The controller method executes, either synchronously or by returning a reactive publisher, and its result flows through Micronaut's content negotiation and serialization layer, typically Jackson-based JSON, before being written back through Netty. Because none of this blocks the event-loop thread while waiting on I/O, a small pool of threads can service a large number of concurrent in-flight requests.
More Related questions...