围绕 Spring Boot 3.5、JDK HttpClient 和 h2c,我做了一次完整压测:先观察 h2c 不会天然更快,再设计一个 0 错误的正例,展示它在特定场景下为什么会比 HTTP/1.1 更占优。
Posts for: #spring-boot
How a Performance Optimization Caused Cascading Redis Timeouts in Spring WebFlux
A seemingly harmless removal of publishOn(Schedulers.boundedElastic()) led to cascading Redis timeouts in production. This post explains how Spring’s @Cacheable blocks the Netty event loop when used with RedisCacheManager, and why BlockHound failed to catch it.
Spring Boot 3 开启 HTTP/2:h2 和 h2c 在什么场景下更合适?
想给 Spring Boot API 加速?来聊聊 HTTP/2 的两种模式:带加密的 h2 和“裸奔”的 h2c,看看在微服务里怎么配置和避坑。
Spring Boot 3.5 + Java 25 + Cloud Native 系列(七):架构 Quality Gates
架构约束很难只靠 Code Review 口头约定。Shop Platform 这边的护栏是 19 条 ArchUnit 规则、6 个 Maven Archetype、WireMock contract testing 和 API 路径版本化校验。
Spring Boot 3.5 + Java 25 + Cloud Native 系列(六):插件化活动引擎
activity-service 是一个插件化的互动游戏引擎,支撑砸金蛋、抢红包、集卡、虚拟养成这些活动。GamePlugin SPI 留的扩展点、Redis Lua 怎么保证抢红包的原子性、AntiCheatGuard 拦什么、水平扩展的前提是什么,都按当前实现来讲。
Spring Boot 3.5 + Java 25 + Cloud Native 系列(五):事件驱动架构
Shop Platform 的事件驱动这层:Kafka 加 Transactional Outbox 保证投递,EventEnvelope 统一信封,IdempotencyGuard 管幂等,重试与 DLQ 各有策略,同步 Saga 和异步事件按场景分工。
Spring Boot 3.5 + Java 25 + Cloud Native 系列(四):领域服务设计
领域服务是微服务里真正承载业务的那一层。Shop Platform 当前实现给出的形态是每服务一套独立 MySQL schema、Flyway 渐进式迁移、JPA 实体与 Repository 按服务组织、Outbox 表配补偿任务、统一响应模型携带 traceId。
Spring Boot 3.5 + Java 25 + Cloud Native 系列(三):BFF 聚合层
Shop Platform 的 BFF 聚合层用 Virtual Threads 做并发编排、Resilience4j 做四层防护,结账走 Saga 加优雅降级,游客不注册也能下单。
Spring Boot 3.5 + Java 25 + Cloud Native 系列(二):API Gateway 架构
API Gateway 是微服务的统一入口。这套仓库里它由 Spring Cloud Gateway Server MVC 加 Virtual Threads 承载,配 JWKS 校验的 JWT 过滤器链、Redis Lua 令牌桶限流和灰度路由,从 WebFlux 迁到 MVC 的取舍也在里面。
Spring Boot 3.5 + Java 25 + Cloud Native 系列(一):Shop Platform 总览
一个以 Java 25 + Spring Boot 3.5 + Spring Cloud 2025 为技术基线的电商平台 POC,涵盖 API 网关、BFF、领域服务、活动引擎与全链路可观测,可作为技术选型讨论的一个可运行参考。