quarkus-expert

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

quarkus-expert

quarkus-expert

Keyword: quarkus | Platforms: gemini,claude,codex
High-Performance Quarkus Framework Expert Skill - Deep production-grade knowledge of the Quarkus ecosystem.
关键词:quarkus | 支持平台:gemini,claude,codex
高性能Quarkus框架专家技能 - 具备Quarkus生态系统的深度生产级知识。

Core Mandates

核心要求

  • Build-Time First: Move processing to augmentation phase, minimize runtime classpath scanning
  • Java 21+ Excellence: Leverage Virtual Threads (
    @RunOnVirtualThread
    ) for blocking operations
  • Reactive Discipline: Use Mutiny (
    Uni
    ,
    Multi
    ) for non-blocking I/O
  • Dependency Discipline: Always use Quarkus BOM for version management
  • Constructor Injection: Mandate constructor injection over field injection
  • 构建时优先: 将处理逻辑移至增强阶段,最大限度减少运行时类路径扫描
  • Java 21+ 优势利用: 针对阻塞操作使用虚拟线程(
    @RunOnVirtualThread
  • 响应式规范: 使用Mutiny(
    Uni
    Multi
    )实现非阻塞I/O
  • 依赖规范: 始终使用Quarkus BOM进行版本管理
  • 构造函数注入: 要求使用构造函数注入而非字段注入

Architectural Patterns

架构模式

Persistence Strategy

持久化策略

  • Imperative: Hibernate ORM with Panache (Active Record or Repository pattern)
  • Reactive: Reactive SQL Clients (MySQL, PostgreSQL, Oracle)
  • Dev Services: Zero-config databases and brokers during development
  • 命令式: 搭配Panache的Hibernate ORM(活动记录或仓库模式)
  • 响应式: 响应式SQL客户端(MySQL、PostgreSQL、Oracle)
  • 开发服务: 开发过程中零配置的数据库和消息代理

Cloud-Native Observability

云原生可观测性

  • OpenTelemetry (OTel): Standard for tracing and metrics
  • Health Checks: Implement
    Liveness
    and
    Readiness
    probes using MicroProfile Health
  • OpenTelemetry (OTel): 链路追踪和指标的标准实现
  • 健康检查: 使用MicroProfile Health实现
    Liveness
    Readiness
    探针

Security Architecture

安全架构

  • Use Proactive Authentication and RBAC with
    @RolesAllowed
  • Prefer OIDC/JWT for stateless microservices
  • 使用主动认证和基于
    @RolesAllowed
    的RBAC
  • 无状态微服务优先采用OIDC/JWT方案

Testing

测试

  • Integration Testing: Use
    @QuarkusTest
    for full-stack tests
  • Mocking: Utilize
    @InjectMock
    and
    @InjectSpy
  • Parity: Use Testcontainers via Dev Services
  • 集成测试: 使用
    @QuarkusTest
    实现全栈测试
  • Mock模拟: 利用
    @InjectMock
    @InjectSpy
  • 环境一致性: 通过开发服务使用Testcontainers

Extension Development

扩展开发

  • Build-Time (Deployment): Write
    BuildStep
    methods for bean registration, bytecode generation
  • Runtime Init: Differentiate between
    STATIC_INIT
    and
    RUNTIME_INIT
  • 构建时(部署阶段): 编写
    BuildStep
    方法实现Bean注册、字节码生成
  • 运行时初始化: 区分
    STATIC_INIT
    RUNTIME_INIT

Troubleshooting

故障排查

  • ClassLoader Leaks: Monitor custom dynamic class loading
  • ContextNotActiveException: Ensure CDI contexts propagate correctly with Mutiny
  • Native Image Failures: Analyze reports and provide
    reflection-config.json
  • 类加载器泄漏: 监控自定义动态类加载行为
  • ContextNotActiveException: 确保CDI上下文随Mutiny正确传播
  • 原生镜像构建失败: 分析报告并提供
    reflection-config.json

🌐 Knowledge Sources & Deep Dives

🌐 知识来源与深度资料

Directive: Use
web_fetch
to read specific guides if the user's question involves a particular extension (e.g., Hibernate, Kafka, OIDC).
使用说明: 如果用户的问题涉及特定扩展(例如Hibernate、Kafka、OIDC),使用
web_fetch
工具读取对应指南。

References

参考资料

Skill Interoperability

技能互操作性

The quarkus-expert ⚡ skill is a comprehensive framework built on:
  • java-expert ☕: Core language and JVM features.
  • vertx-expert 🌀: Reactive engine for non-blocking operations.
  • graalvm-expert 🚀: Native Image generation and AOT optimization.
quarkus-expert ⚡ 技能是基于以下技术构建的综合框架:
  • java-expert ☕: 核心语言与JVM特性。
  • vertx-expert 🌀: 用于非阻塞操作的响应式引擎。
  • graalvm-expert 🚀: 原生镜像生成与AOT优化。