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

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

欢迎合作

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

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • 机器学习算法与Python实战 | 8个特征工程技术,提高机器学习预测能力
  • 关于java中Excel的导入导出
  • Python自动化办公2.0 课程更新
  • 非阻塞轮询
  • C++第四十二弹---C++11新特性深度解析:让你的代码更现代、更高效(中)
  • 【conda】导出和重建 Conda 环境
  • mysql 一主一从数据库的配置文件
  • GPS北斗授时服务器(网络时钟系统)助力金融领域
  • windows权限维持汇总
  • 【ubuntu24.04】AX210/MT9621/USB网络共享访问无线网络
  • 深入解析Node.js中的new URL()构造函数:功能、属性、方法与使用技巧
  • OpenStack——keystone认证服务
  • Linux 流式DMA映射(DMA Streaming Mapping)
  • 【Qt笔记】QToolButton控件详解
  • 有哪些内部知识库类似钉钉,满足企业多样化需求?
  • [译]前端离线指南(上)
  • 《网管员必读——网络组建》(第2版)电子课件下载
  • 2019.2.20 c++ 知识梳理
  • CAP理论的例子讲解
  • Docker下部署自己的LNMP工作环境
  • HTTP中的ETag在移动客户端的应用
  • IndexedDB
  • LintCode 31. partitionArray 数组划分
  • miaov-React 最佳入门
  • python学习笔记-类对象的信息
  • Sublime Text 2/3 绑定Eclipse快捷键
  • Vue 2.3、2.4 知识点小结
  • 工程优化暨babel升级小记
  • 开源SQL-on-Hadoop系统一览
  • 实战|智能家居行业移动应用性能分析
  • 事件委托的小应用
  • 蚂蚁金服CTO程立:真正的技术革命才刚刚开始
  • 如何正确理解,内页权重高于首页?
  • 智能情侣枕Pillow Talk,倾听彼此的心跳
  • #AngularJS#$sce.trustAsResourceUrl
  • (3)选择元素——(17)练习(Exercises)
  • (9)目标检测_SSD的原理
  • (二)换源+apt-get基础配置+搜狗拼音
  • (实战篇)如何缓存数据
  • (转)jdk与jre的区别
  • (转)memcache、redis缓存
  • (转)winform之ListView
  • (转)清华学霸演讲稿:永远不要说你已经尽力了
  • *算法训练(leetcode)第四十天 | 647. 回文子串、516. 最长回文子序列
  • .NET Framework 的 bug?try-catch-when 中如果 when 语句抛出异常,程序将彻底崩溃
  • .NET Reactor简单使用教程
  • .net6 当连接用户的shell断掉后,dotnet会自动关闭,达不到长期运行的效果。.NET 进程守护
  • .net经典笔试题
  • .NET开发不可不知、不可不用的辅助类(三)(报表导出---终结版)
  • .Net通用分页类(存储过程分页版,可以选择页码的显示样式,且有中英选择)
  • .w文件怎么转成html文件,使用pandoc进行Word与Markdown文件转化
  • /bin/bash^M: bad interpreter: No such file ordirectory
  • ::
  • @Builder注释导致@RequestBody的前端json反序列化失败,HTTP400
  • [ solr入门 ] - 利用solrJ进行检索