Quarkus - Guides

目录

核心

Web

数据

消息

安全

Business Automation

集成

监测

序列化

工具

兼容

Writing Extensions

Alternative Languages

其它

你已经通过入门指南,可以准备深入到特定主题指南了。

程序配置

在代码中硬编码值是不可行的(这种事我们都干过)。该指南我们将学习如何配置应用

阅读指南

所有的配置项

列出每个扩展的所有配置项

阅读指南

程序启动及终止

我们会需要在程序启动时执行一些特定的代码,或者程序结束时执行清理。该指南解释了程序启动或停止时如何通知我们。

阅读指南

上下文依赖注入

Quarkus DI 方案基于 Java 上下文依赖注入 v2.0 标准。但是它不是一个符合 TCK 的完整 CDI 实现。 只实现了 CDI 一部分功能 —— 可以查看支持及限制列表。

阅读指南

程序测试

该指南包括:

  • JVM 模式下测试
  • 原生模式测试
  • 测试中注入资源

阅读指南

日志配置

该指南讲述了日志及如何配置它.

阅读指南

原生镜像中使用 SSL

该指南,将讨论原生镜像中如何支持 SSL , SSL 不是原生镜像默认开启功能。

阅读指南

上下文传播

了解更多有关如何通过 MicroProfile Context Propagation 传播上下文信息的信息。

阅读指南

编写原生应用

本指南收集了一些技巧,帮助解决编译成本地可执行文件时遇到的问题。

阅读指南


Web

REST JSON 接口

JSON现在是微服务之间的通用语言。在本指南中,我们将看到如何使REST服务能够使用和返回 JSON 数据.

阅读指南

Hibernate Validator 进行验证

This guide covers how to use Hibernate Validator/Bean Validation in your REST services.

阅读指南

调用 REST 接口(包括 JSON)

This guide explains how to use the MicroProfile REST Client in order to interact with REST APIs (JSON and other) with very little effort.

阅读指南

发送文件给 REST 接口

This guide explains how to use the MicroProfile REST Client to send multipart REST requests, typically to upload documents.

阅读指南

Using JWT RBAC

This guide explains how your application can utilize MicroProfile JWT RBAC to provide secured access to the JAX-RS endpoints.

阅读指南

使用 WebSockets

This guide explains how your Quarkus application can utilize web sockets to create interactive web applications. Because it’s the canonical web socket application, we are going to create a simple chat application.

阅读指南

使用 OpenAPI 和 Swagger UI

This guide explains how to use the OpenAPI extension to generate an OpenAPI descriptor and get a Swagger UI frontend to test your REST endpoints.

阅读指南

HTTP 参考

Learn more about configuring Quarkus’ Vert.x based HTTP layer - and Undertow if you are using servlets.

阅读指南

使用熔断

This guide demonstrates how your Quarkus application can utilize the MicroProfile Fault Tolerance specification through the SmallRye Fault Tolerance extension.

阅读指南

使用响应式路由

This guide demonstrates how to use reactive routes.

阅读指南


数据

配置数据源

With Quarkus, you can easily configure a datasource, or several if need be.

阅读指南

使用 Hibernate ORM 和 JPA

Hibernate ORM is the de facto JPA implementation and offers you the full breath of an Object Relational Mapper. It works beautifully in Quarkus.

阅读指南

用 Panache 简便 Hibernate ORM

Hibernate ORM is the de facto JPA implementation and offers you the full breadth of an Object Relational Mapper.

It makes complex mappings possible, but it does not make simple and common mappings trivial.

Panache focuses on making your entities trivial and fun to write.

阅读指南

Hibernate Search + Elasticsearch

Hibernate Search allows you to index your entities in an Elasticsearch cluster and easily offer full text search in all your Hibernate ORM-based applications.

阅读指南

使用事务

Quarkus comes with a Transaction Manager and uses it to coordinate and expose transactions to your applications. Each extension dealing with persistence will integrate with it for you. And you will explicitly interact with transactions via CDI. This guide will walk you through all that.

阅读指南

用 Hibernate Validator 验证

This guide covers how to use Hibernate Validator/Bean Validation in your REST services.

阅读指南

缓存应用数据

This guide explains how to cache expensive method calls of your CDI beans using simple annotations.

阅读指南

用 Flyway 迁移表结构

This guide covers how to use the Flyway extension to manage your schema migrations.

阅读指南

用 Liquibase 迁移表结构

This guide covers how to use the Liquibase extension to manage your schema migrations.

阅读指南

用 Infinispan 客户端

Infinispan is an in memory data grid that allows running in a server outside of application processes. This extension provides functionality to allow the client that can connect to said server when running in Quarkus.

阅读指南

响应式 SQL 客户端

This guide covers how to use the Reactive SQL Clients for MySQL and PostgreSQL in Quarkus.

阅读指南

MongoDB 客户端

This guide covers how to use MongoDB in Quarkus.

阅读指南

Panache 使用 MongoDB

This guide covers the usage of MongoDB using active records and repositories.

阅读指南

Neo4j 客户端

This guide covers how to use the Neo4j graph database in Quarkus.

阅读指南

Amazon DynamoDB

This guide covers how to use the Amazon DynamoDB database in Quarkus.

阅读指南

使用软件事务内存(STM)

This guides covers the usage of Software Transactional Memory (STM)

阅读指南


消息

使用 Apache Kafka

This guide demonstrates how your Quarkus application can utilize MicroProfile Reactive Messaging to interact with Apache Kafka.

阅读指南

AMQP 的响应式消息

This guide demonstrates how your Quarkus application can utilize MicroProfile Reactive Messaging to interact with AMQP.

阅读指南

使用 Apache Kafka 流

This guide demonstrates how your Quarkus application can utilize the Apache Kafka Streams API to implement stream processing applications based on Apache Kafka.

阅读指南

异步消息传输

This guide explains how different beans can interact using asynchronous messages.

阅读指南

使用 JMS

This guide demonstrates how your Quarkus application can use JMS messaging with AMQP 1.0 using Apache Qpid JMS, or using Apache ActiveMQ Artemis JMS.

阅读指南


安全

使用安全

This quide demonstrates integration with the Elytron security subsystem to allow for RBAC based on the common security annotations @RolesAllowed, @DenyAll, @PermitAll on REST endpoints.

阅读指南

用 .properties 文件实现安全

This guide demonstrates how your Quarkus application can use a .properties file to store your user identities.

阅读指南

用 JPA 实现安全

This guide demonstrates how your Quarkus application can use a database to store your user identities with Hibernate ORM.

阅读指南

用 JDBC 实现安全

This guide demonstrates how your Quarkus application can use a database to store your user identities.

阅读指南

用 OpenID 连接来保护服务程序

This guide demonstrates how your Quarkus application can use Keycloak to protect your JAX-RS applications using bearer token authorization, where these tokens are issued by a Keycloak server.

阅读指南

用 OpenID 连接来保护 Web 应用

This guide demonstrates how to use the OpenID Connect Extension to protect your web application based on the Authorization Code Flow using Quarkus.

阅读指南

Using OpenID Connect Multi-Tenancy

This guide demonstrates how your OpenID Connect application can support multi-tenancy so that you can serve multiple tenants from a single application.

阅读指南

使用 OpenID Connect 和 Keycloak 实现中心化授权

This guide demonstrates how your Quarkus application can authorize access to protected resources using Keycloak Authorization Services.

阅读指南

使用 JWT RBAC

This guide explains how your application can utilize MicroProfile JWT RBAC to provide secured access to the JAX-RS endpoints.

阅读指南

使用 OAuth2 RBAC

This guide explains how your Quarkus application can utilize OAuth2 tokens to provide secured access to the JAX-RS endpoints.

阅读指南

使用 Vault

This quide explains how you can use HashiCorp Vault to securely store your credentials in Quarkus.

阅读指南

使用 Vault Transit Secret Engine

This quide explains how you can use HashiCorp Vault for “encryption as a service”.

阅读指南


Business Automation

Using Kogito to add business automation capabilities to an application

This guide demonstrates how your Quarkus application can use Kogito to add business automation to power it up with business processes and rules.

阅读指南

Using AI to optimize a schedule with OptaPlanner

This guide walks you through the process of creating a Quarkus application with OptaPlanner’s constraint solving Artificial Intelligence (AI).

阅读指南


集成

Apache Camel

This guide covers the systems integration with Apache Camel

阅读指南


构建容器镜像

Learn how to build and push container images with Jib, S2I or Docker as part of the Quarkus build.

阅读指南

发布 Quarkus 应用到 Kubernetes

This guide covers how to deploy a native application on Kubernetes.

阅读指南

发布 Quarkus 应用到 OpenShift

This guide covers how to deploy a native application on OpenShift.

阅读指南

用 S2I 发布到 OpenShift

This guide explains how to deploy a Quarkus application to OpenShift using S2I.

阅读指南

发布原生应用到 Knative Kubernetes 或 OpenShift

This guide demonstrates how to deploy an application on Knative Kubernetes or OpenShift.

阅读指南

Using the Kubernetes Client to Interact with a Kubernetes Cluster

This guide demonstrates how to use the Fabric8 Kubernetes client to interact with your Kubernetes cluster.

阅读指南

Deploying to Microsoft Azure Cloud

This guide explains how to deploy a Quarkus application to Microsoft Azure Cloud.

阅读指南

Azure Functions (Serverless) with Vert.x Web, Servlet, or RESTEasy

This guide explains how you can deploy Vert.x Web, Servlet, or RESTEasy microservices as an Azure Function.

阅读指南

Amazon Lambda

This guide explains how you can deploy Quarkus-based Amazon Lambdas.

阅读指南

Amazon Lambda with Vert.x Web, Servlet, or RESTEasy

This guide explains how you can deploy Vert.x Web, Servlet, or RESTEasy microservices as an Amazon Lambda.

阅读指南


监测

使用健康检查

This guide demonstrates how your Quarkus application can utilize the MicroProfile Health specification through the SmallRye Health extension.

阅读指南

使用 OpenTracing

This guide explains how your Quarkus application can utilize OpenTracing to provide distributed tracing for interactive web applications.

阅读指南

采集指标

This guide demonstrates how your Quarkus application can utilize the MicroProfile Metrics specification through the SmallRye Metrics extension.

阅读指南

使用熔断器

This guide demonstrates how your Quarkus application can utilize the MicroProfile Fault Tolerance specification through the SmallRye Fault Tolerance extension.

阅读指南

用 Sentry 监控日志

This guide explains how to use Sentry to monitor your application and be notified when exceptions occur.

阅读指南

日志集中管理

This guide explains how to centralize your logs with Logstash or Fluentd using the Graylog Extended Log Format (GELF).

阅读指南


序列化

Writing REST JSON Services

JSON is now the lingua franca between microservices. In this guide, we see how you can get your REST services to consume and produce JSON payloads.

阅读指南


工具

用 Maven 构建应用

This guide covers:

  • Maven configuration
  • Creating a new project
  • Dealing with extensions
  • Development mode
  • Debugging
  • Import in your IDE
  • Building a native image
  • Build a container friendly executable

阅读指南

用 Gradle 构建应用

This guide covers:

  • Gradle configuration
  • Creating a new project
  • Dealing with extensions
  • Development mode
  • Debugging
  • Import in your IDE
  • Building a native image
  • Build a container friendly executable

阅读指南

Measuring the coverage of your tests

This guide explains how to measure the test coverage of your Quarkus application.

阅读指南


兼容

Using the Quarkus Extension for Spring DI API

While you are encouraged to use CDI annotations for injection, Quarkus provides a compatibility layer for Spring dependency injection in the form of the spring-di extension.

阅读指南

Using the Quarkus Extension for Spring Web API

While you are encouraged to use JAX-RS annotations for defining REST endpoints, Quarkus provides a compatibility layer for Spring Web in the form of the spring-web extension.

阅读指南

Using the Quarkus Extension for Spring Data JPA API

While you are encouraged to use Hibernate ORM with Panache for your data layer, Quarkus provides a compatibility layer for Spring Data JPA in the form of the spring-data-jpa extension.

阅读指南

Using the Quarkus Extension for Spring Security API

While you are encouraged to use the Quarkus security layer to secure your applications, Quarkus provides a compatibility layer for Spring Security in the form of the spring-security extension.

阅读指南

Using the Quarkus Extension for Spring Cloud Config

Quarkus provides a compatibility layer for Spring Cloud Config in the form of the spring-cloud-config-client extension.

阅读指南


Writing Extensions

Writing Your Own Extension

Quarkus extensions add a new developer focused behavior to the core offering, and consist of two distinct parts, buildtime augmentation and runtime container. The augmentation part is responsible for all metadata processing, such as reading annotations, XML descriptors etc. The output of this augmentation phase is recorded bytecode which is responsible for directly instantiating the relevant runtime services.

This means that metadata is only processed once at build time, which both saves on startup time, and also on memory usage as the classes etc that are used for processing are not loaded (or even present) in the runtime JVM.

阅读指南

Writing Native Applications

This guide is a collection of tips to help you solve the problems you encounter when compiling applications to native executable.

阅读指南

Class Loading Reference

Learn more about Quarkus class loading infrastructure.

阅读指南


Alternative Languages

Using Kotlin

This guide explains how to use Kotlin.

阅读指南


其它

定时任务

Modern applications often need to run specific tasks periodically. In this guide, you learn how to schedule periodic tasks.

阅读指南

Scheduling Clustered Tasks with Quartz

You need clustering support for your scheduled tasks? This guide explains how to use the Quartz extension for that.

阅读指南

发送 Email

Learn more about how you can send email from a Quarkus application with our reactive email client.

阅读指南

用 Qute 模版

Learn more about how you can use templating in your applications with the Qute template engine.

阅读指南

Qute 参考指南

Learn everything you need to know about the Qute template engine.

阅读指南

用 Apache Tika 解析内容

Learn more about how you extract content from documents using the Apache Tika toolkit.

阅读指南

使用 Vert.x

This guide explains how to use Vert.x in Quarkus to build reactive applications.

阅读指南

Access Git repositories with JGit

This guide explains how you can access Git repositories with JGit.

阅读指南

性能指标

When measuring the footprint of a Quarkus application, we measure Resident Set Size (RSS) and not the JVM heap size which is only a small part of the overall problem. The JVM not only allocates native memory for heap (-Xms, -Xmx) but also structures required by the jvm to run your application.

阅读指南

quarkus.pro 是基于 quarkus.io 的非官方中文翻译站 ,最后更新 2020/04 。
沪ICP备19006215号-8
QQ交流群:1055930959
微信群: