Skip to content

Latest commit

 

History

History
55 lines (35 loc) · 1.24 KB

README.md

File metadata and controls

55 lines (35 loc) · 1.24 KB

app-reactive Project

reactive入门

maven命令行创建项目

$ mvn io.quarkus.platform:quarkus-maven-plugin:2.10.0.Final:create \                                                                     ✔ 
-DprojectGroupId=org.example \
-DprojectArtifactId=app-reactive \
-DnoCode

添加必要的扩展

$ cd app-reactive
$ ./mvnw quarkus:add-extension -Dextensions="hibernate-reactive-panache,resteasy-reactive-jackson,reactive-mysql-client,jdbc-mariadb" 

添加数据路配置

src/main/resource/application.properties文件中添加数据库配置

quarkus.datasource.db-kind=mariadb
quarkus.datasource.username=hongda
quarkus.datasource.password=hongda
quarkus.datasource.reactive.url=mysql://localhost:3306/quarkus
quarkus.datasource.reactive.max-size=16


# drop and create the database at startup (use `update` to only update the schema)
quarkus.hibernate-orm.database.generation=drop-and-create
quarkus.hibernate-orm.log.sql=true
quarkus.hibernate-orm.sql-load-script=import.sql

添加健康检查

$ ./mvnw quarkus:add-extension -Dextensions="quarkus-smallrye-health"

添加opanapi

$ ./mvnw quarkus:add-extension -Dextensions="quarkus-smallrye-openapi"