当前位置: 首页 > article >正文

Quarkus 后端开发记录

最近业余在开发一款智能助理产品,记录开发过程中的一些问题以备忘,也是帮其他人防坑。

主要技术栈

  • Quarkus: the Supersonic Subatomic Java Framework.
  • RESTEasy Reactive: 实现 RESTful 接口 (JAX-RS)
  • Hibernate Reactive: 是 Hibernate ORM 的响应式 API,支持非阻塞数据库驱动程序和响应式与数据库的交互方式。
  • Panache: 简化基于 Jakarta REST、Hibernate ORM 的 CRUD 操作
  • Neo4j: 图数据库
  • Postgresql: 关系型数据库
  • GraphQL: 接口
  • JWT: 认证
  • websocket: 实时通信
  • JDK 17
  • Apache Maven

前端 Nextjs 技术栈

开发

启动开发模式,支持代码热加载:

./mvnw compile quarkus:dev

提示: Quarkus 开发模式下提供了一个 Dev UI:http://localhost:8080/q/dev-ui/ .

接口

Openapi swagger-ui
http://localhost:8080/q/swagger-ui

打包

./mvnw package

打包完成在 target/quarkus-app/ 目录下生成 quarkus-run.jar 文件.
注意默认不是 über-jar 模式, 相关依赖会生成到 target/quarkus-app/lib/ 目录下.

运行

java -jar target/quarkus-app/quarkus-run.jar.

über-jar 打包模式:

./mvnw package -Dquarkus.package.type=uber-jar
# 运行
java -jar target/*-runner.jar

创建本地可执行程序

./mvnw package -Pnative

Or, if you don’t have GraalVM installed, you can run the native executable build in a container using:

./mvnw package -Pnative -Dquarkus.native.container-build=true

运行程序: ./target/xueji-server-1.0.0-SNAPSHOT-runner

更多关于创建本地应用参考: https://quarkus.io/guides/maven-tooling.

注意

  • 端口按照应用核心的需要来设计而不是简单地套用工具的 API。 it is of utmost importance that the Ports are created to fit the Application Core needs and not simply mimic the tools APIs.
  • 配置阿里格式 Idea 插件: https://github.com/alibaba/p3c/blob/master/idea-plugin/README_cn.md

升级 Quarkus

Chocolatey is a package manager for Windows.

# 安装
choco install quarkus 
# 升级 quarkus cli
choco upgrade quarkus
# 升级 quarkus 版本
quarkus update

指南

  • Explicit Architecture (guide): 架构设计,DDD, Hexagonal, Onion, Clean, CQRS, … How I put it all together
  • RESTEasy Reactive (guide): A Jakarta REST implementation utilizing build time processing and Vert.x. This extension is not compatible with the quarkus-resteasy extension, or any of the extensions that depend on it.
  • Mutiny(guide): Intuitive Event-Driven Reactive Programming Library for Java
  • Quarkus Neo4j (guide): Quarkus-Neo4j extension, based on the official Neo4j Java Driver.
  • Hibernate Reactive Panache (guide): Making your entities trivial and fun to write in Quarkus.
  • Reactive PostgreSQL client (guide): Connect to the PostgreSQL database using the reactive pattern
  • REST Client Reactive (guide): Interact with REST APIs
  • WebSockets (guide): WebSocket communication channel support
  • SmallRye JWT (guide): Secure your applications with JSON Web Token
  • SmallRye JWT Build (guide): Create JSON Web Token with SmallRye JWT Build API
  • SmallRye GraphQL (guide): Create GraphQL Endpoints using the code-first approach from MicroProfile GraphQL
  • Transaction Manager (guide): Quarkus comes with a Transaction Manager and uses it to coordinate and expose transactions to your applications
  • Scheduler (guide): Schedule jobs and tasks

欢迎合作

如果这篇文章对您有所帮助,欢迎点赞、分享和留言,让更多的人受益。感谢您的细心阅读,如果发现了任何错误或需要补充的地方,请随时告诉我,我会尽快处理 ^_^


http://www.kler.cn/news/283583.html

相关文章:

  • matlab 采样的非周期性矩形
  • 在野漏洞的应急响应流程
  • 【drools】kie:官方仓库clone 遇到问题解决
  • 利用API接口实现商品信息自动化更新的高效策略
  • centos基础设置
  • 【面试经验】字节商业产品日常实习面经
  • MySQL给用户授权
  • k8S Deployment
  • 计算机毕业设计选题推荐-汽车租赁系统-Java/Python项目实战
  • 整理了几十家高频面试题,让你避坑软件测试公司面试的套路,收藏收藏刷起来...
  • 「OC」CAlayer——巧用动画实现一个丝滑的折叠cell
  • 云端集中管控边缘服务:利用 EMQX ECP 在 K8s 上快速部署 NeuronEX
  • 删除微信重复文件的简易工具
  • unreal engine5中character角色和怪物交互时发生穿模
  • Kubernetes存储Volume
  • 借题《黑神话悟空》,聊聊UE5 游戏开发中基本的 C++ 概念
  • 日常刷题(24)
  • 【为项目做准备】Linux操作系统day1
  • STM32G474采用“多个单通道ADC转换”读取3个ADC引脚的电压
  • 报错:E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。
  • [java][基础]ArrayList基本使用
  • NLP(三):词向量
  • 如何利用ChatGPT高效学习英语:从零基础到流利表达
  • 优化 spring boot 的启动速度
  • 打工人 Excel 插件 - 电子表格智能辅助插件正版购买
  • okhttp异步请求连接阻塞问题排查
  • 安卓13 背光反向 亮度反向 android13 backlight reverse
  • 家里两个路由器IP地址一样吗?‌IP地址冲突怎么办?‌
  • 数据结构代码分享
  • 机器视觉--光源打光技巧