Repository navigation
fix(wx-java-mp): 修复 Spring Boot Starter 的 Redisson 客户端回退 - #4147
miemieYaho wants to merge 2 commits into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f0562b4baa
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| @Bean | ||
| @ConditionalOnProperty(prefix = WxMpProperties.PREFIX + ".config-storage.redis", name = "host") | ||
| @Bean(REDISSON_CLIENT_BEAN) | ||
| @Conditional(RedisHostConfiguredCondition.class) |
There was a problem hiding this comment.
这次修复的核心依赖于 Spring 解析 @Conditional 后是否注册 wxMpRedissonClient,但提交中没有任何测试覆盖,现有的 compile 验证不会执行这里的条件或 bean 查找。请至少用应用上下文分别覆盖“省略 redis.host 且应用提供 RedissonClient”和“显式配置 host 后创建专用 bean”的启动场景,否则原始初始化失败很容易在后续改动中回归。
AGENTS.md reference: AGENTS.md:L64-L64
Useful? React with 👍 / 👎.
问题
公众号 Spring Boot Starter 配置
wx.mp.config-storage.type=redisson且省略wx.mp.config-storage.redis.host时,RedisProperties的默认 host 会让客户端查找走到wxMpRedissonClient。该 Bean 没有注册,导致WxMpService初始化失败。Solon 插件的同类问题已在 #4048 修复。修改
false的 host 时注册公众号专用 Redisson 客户端。RedissonClient。保留RedisProperties的默认值,避免影响其他存储策略。验证
使用
mvn -pl spring-boot-starters/wx-java-mp-spring-boot-starter -am -DskipTests compile编译通过。