Spring 5Reactive示例Spring WebFlux实战参考

Spring5 的 Reactive 玩法示例,spring-active-sample 算是个比较全的参考了。项目里集成了Spring WebFluxSpring Boot 2.4Spring Data R2dbc,也就是你常听的“响应式编程三件套”。想搞清楚怎么写非阻塞的后端逻辑、怎么和数据库打交道,这里面的代码都挺有。

React 那边也不是简单贴一下前端,基本配好了前后端联调的流程,启动就能跑,连数据库连接也顺手带了。你用Application.java直接跑起来就行,响应也快,代码也清爽。

除了主线的vanilla方案,还有用 Jetty 当运行时的变种,对比着看挺有意思的。WebFlux 项目经常会卡在部署和环境配置上,这里都已经帮你踩过坑了。

代码是偏实战的,不是那种一堆注释写论文的 demo,直接能拿来拆着看、改着用。你要是想了解 Spring 5 响应式到底怎么玩,建议把这个 repo 先过一遍,再去看点儿底层实现,比如 Spring Boot 框架源码解析 也不错。

嗯对了,最好别用Spring Boot 2.0版本,项目都写明了不推荐,会有兼容性问题。如果你现在用的是 2.4 或者更新的版本,那基本能无缝衔接。

如果你刚开始接触WebFlux,或者在做响应式开发的项目,这个资源还挺值得收藏的。

folder
spring-active-sample:Spring5React堆运动场 预估大小:1220个文件
file
mvnw.cmd 5KB
file
mvnw.cmd 6KB
file
mvnw.cmd 5KB
file
mvnw.cmd 6KB
file
mvnw.cmd 6KB
file
mvnw.cmd 6KB
file
mvnw.cmd 6KB
file
mvnw.cmd 6KB
file
mvnw.cmd 6KB
file
mvnw.cmd 6KB
file
mvnw.cmd 6KB
file
mvnw.cmd 6KB
file
mvnw.cmd 6KB
file
mvnw.cmd 6KB
file
mvnw.cmd 6KB
file
mvnw.cmd 6KB
file
mvnw.cmd 6KB
file
mvnw.cmd 6KB
file
mvnw.cmd 6KB
file
index.adoc 821B
zip 文件大小:4.97MB