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.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
