AI / LangChain4j interview questions
What is LangChain4j's support for Quarkus and how does it differ from Spring Boot integration?
LangChain4j has a dedicated Quarkus extension (quarkus-langchain4j) maintained under the Quarkiverse umbrella. It provides CDI-based injection, Quarkus-native configuration, and — critically — native compilation support through GraalVM, enabling LangChain4j applications to be compiled to native executables with sub-second startup times.
The main differences from the Spring Boot integration:
| Aspect | Spring Boot Integration | Quarkus Integration |
|---|---|---|
| Dependency injection | Spring IoC / @Autowired | CDI / @Inject |
| Configuration | application.properties (spring.langchain4j.*) | application.properties (quarkus.langchain4j.*) |
| AI Service registration | @AiService (or @Bean) | @RegisterAiService |
| Native image support | Spring Native (experimental for AI libs) | First-class via GraalVM — officially supported |
| Dev mode | Spring DevTools hot reload | Quarkus Dev mode live reload + Dev UI panel for AI |
| Observability | Spring Actuator + Micrometer | Quarkus OpenTelemetry auto-instrumentation |
// Quarkus - register an AI service with @RegisterAiService @RegisterAiService(tools = WeatherTools.class) interface WeatherAssistant { @SystemMessage("You are a weather assistant.") String chat(String userMessage); } // Inject it as a CDI bean @ApplicationScoped class WeatherEndpoint { @Inject WeatherAssistant assistant; }
Quarkus Dev mode provides a visual Dev UI panel specifically for LangChain4j where you can inspect registered AI services, test prompts interactively, and view conversation history — a significant developer experience advantage over the Spring Boot approach for teams working on Quarkus applications.
More Related questions...