Prev Next

Java / Quarkus Interview questions

Explain the execution flow of a REST request in Quarkus using RESTEasy Reactive?

A request handled by RESTEasy Reactive takes a different path depending on whether the matched resource method is blocking or reactive, and understanding that fork is key to understanding Quarkus's concurrency model.

sequenceDiagram participant Client participant VertxEL as Vert.x Event Loop participant Router as RESTEasy Reactive Router participant Worker as Worker Thread Pool participant Method as Resource Method Client->>VertxEL: HTTP request arrives VertxEL->>Router: Route to matching @Path method Router->>Router: Inspect method return type alt Reactive (Uni/Multi) Router->>Method: Invoke directly on event loop Method-->>VertxEL: Non-blocking result emitted asynchronously else Blocking (plain return type) Router->>Worker: Dispatch to worker thread Worker->>Method: Invoke method (may block) Method-->>VertxEL: Result handed back to event loop end VertxEL-->>Client: HTTP response written

The event loop itself never blocks: for a plain, non-reactive method, RESTEasy Reactive automatically dispatches execution onto a worker thread pool before invoking it, so blocking calls like a synchronous JDBC query don't stall the event loop that's also responsible for handling every other concurrent connection.

For a method returning Uni or Multi, no dispatch to a worker thread happens at all — the method runs directly on the event loop, and as long as it never performs a blocking call itself, a single event-loop thread can interleave handling many concurrent in-flight requests, which is the throughput advantage reactive endpoints offer over blocking ones under high concurrency.

What happens to a blocking resource method's execution in RESTEasy Reactive?
Why must a reactive method avoid making blocking calls itself?

More Related questions...

What is Quarkus? What is the purpose of Quarkus? What are the key features of Quarkus? What is GraalVM in the context of Quarkus? What is Supersonic Subatomic Java? What are the two runtime modes of Quarkus? What is a native executable in Quarkus? What is Quarkus Dev Mode? What are Quarkus extensions? How do you create a new Quarkus project? What is the Mutiny library used for in Quarkus? What is Panache in Quarkus? What are the types of Panache entity patterns available? What is CDI in Quarkus? What is the purpose of the @ApplicationScoped annotation? What is RESTEasy Reactive in Quarkus? Define Quarkus configuration profiles? What is application.properties used for in Quarkus? List the build tools supported by Quarkus? What is a Quarkus BuildItem? What is the difference between Quarkus and Spring Boot? Why does Quarkus have faster startup time than traditional Java frameworks? How does Quarkus achieve low memory footprint? Explain the build-time vs runtime processing model in Quarkus? What is the difference between JVM mode and native mode in Quarkus? How does Quarkus support GraalVM native image compilation? Explain the lifecycle of a Quarkus application build? What happens when you run "quarkus dev"? How do you configure a Quarkus application for different environments using profiles? What is the difference between @Inject and @ConfigProperty in Quarkus? How does dependency injection work in Quarkus vs traditional CDI containers? Explain the internal working of Quarkus extensions? What is the difference between imperative and reactive programming in Quarkus? How does Quarkus handle reactive messaging with Kafka? When should you use Quarkus over a traditional Spring application? What is the difference between Panache Active Record and Repository pattern? How do you write integration tests in Quarkus using @QuarkusTest? Explain the execution flow of a REST request in Quarkus using RESTEasy Reactive? How does Quarkus support GraalVM substitutions for native compilation issues? What is the difference between Quarkus and Micronaut? How do you troubleshoot a native image build failure in Quarkus? Explain the lifecycle of application startup in native mode vs JVM mode? How does Quarkus achieve ahead-of-time (AOT) compilation benefits? What is the role of the Quarkus Arc container? How do you secure a Quarkus application with OIDC? Explain the internal working of Quarkus's build-time class initialization? How does Quarkus support Kubernetes-native deployments? What is the difference between Quarkus's Vert.x-based reactive engine and traditional servlet-based engines? How do you optimize Quarkus native image build times? Explain the execution flow of a reactive messaging pipeline using SmallRye Reactive Messaging in Quarkus?
Show more question and Answers...


Comments & Discussions