Repository navigation
fix(wx-java-mp): 对齐 MiniApp 的 Redis host 默认值 - #4148
miemieYaho wants to merge 8 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: c00082c48c
ℹ️ 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".
| * 主机地址. | ||
| */ | ||
| private String host = "127.0.0.1"; | ||
| private String host; |
There was a problem hiding this comment.
在 wx.mp.config-storage.type=jedis/redisson 场景,此行把“省略 host”变成复用容器中客户端的配置契约,但该模块的 README.md 仍只给出显式的 host=127.0.0.1,当前字段说明也没有说明省略值需要现有客户端;发布后用户无法从随包文档得知新用法,并会在容器中没有相应 bean 时直到启动阶段才看到失败。请同步补充 host 的省略语义及前置条件。
AGENTS.md reference: AGENTS.md:L89-L89
Useful? React with 👍 / 👎.
| * 主机地址. | ||
| */ | ||
| private String host = "127.0.0.1"; | ||
| private String host; |
There was a problem hiding this comment.
该修改通过把 host 默认值设为 null 来切换 WxMpInRedissonConfigStorageConfiguration 和 WxMpInJedisConfigStorageConfiguration 的 bean 查找分支,但受影响模块当前没有测试覆盖“省略 host 且容器已有客户端”的启动场景;以后默认值或分支改动时,原来的 NoSuchBeanDefinitionException 可以直接回归而 CI 无法发现。请添加最小 Spring 上下文回归测试,至少验证未配置 host 时会复用已有 RedissonClient,并覆盖同一字段影响的 Jedis 分支。
AGENTS.md reference: AGENTS.md:L64-L64
Useful? React with 👍 / 👎.
变更
将公众号 Spring Boot Starter 的 Redis
host默认值改为null,与 MiniApp 对齐。应用已经提供RedissonClient时,只设置wx.mp.config-storage.type=redisson即可复用该客户端。MiniApp 的
RedisProperties.host没有初始值。省略 host 时,MiniApp 按类型查找应用已有的RedissonClient。MP 原有代码也有相同的回退分支,但默认的127.0.0.1会让查找误入专用客户端分支。此时wxMpRedissonClient因缺少 host 配置而没有注册,导致WxMpService初始化失败。显式配置有效 host 时,MP 仍由 Spring 创建并管理专用客户端。MP 的 Jedis 模式也使用同一个
host属性,省略 host 时会复用应用提供的JedisPool。验证
mvn -pl spring-boot-starters/wx-java-mp-spring-boot-starter -am -DskipTests compile编译通过。替代 #4147。