CompressionType.of fails under the Turkish locale

未关闭 适合新手
#11,512 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@sharanggupta 已经在做这个了。

开始于 2026年11月12日。

  • #11513 来自 @sharanggupta —— 未关闭
  • #11514 来自 @xixi-box —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
83/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
java

调研方向

在 RocketMQ 仓库中找到 CompressionType.of(String) 及其测试。阅读解析逻辑和附近的测试,然后在添加一个针对土耳其语区域设置下解析 zlib 的回归用例前后,运行相关测试。在该区域设置下,此用例解析为 ZLIB 压缩类型即为完成;issue 指出 Locale.ROOT 是预期的规范化方式。

由索引模型根据 Issue 内容生成。

描述

Describe the bug
CompressionType.of(String) normalises the name with name.trim().toUpperCase() (no Locale). Under the Turkish locale (tr-TR, also az), a lower/mixed-case value containing i folds to the dotted capital İ, so "zlib".toUpperCase() -> "ZLİB", which does not match case "ZLIB" and falls through to throw new RuntimeException("Unsupported compress type name: ...").

Impact
A producer JVM under a Turkish default locale throws when the compression type is given in lower/mixed case, e.g. -Drocketmq.message.compressType=zlib (DefaultMQProducer reads rocketmq.message.compressType) or the benchmark -ct zlib. The uppercase form ZLIB (the default) is unaffected, so this only hits configs relying on the documented case-insensitive parsing.

Version: 5.5.1 and current develop.

Fix: toUpperCase(Locale.ROOT) — the keyword set is ASCII. One-line fix + regression test ready; happy to open a PR.

Sibling instances of the same root cause exist in the common module (TopicMessageType.getMetricsValue() metric labels; OS-name checks in NetworkUtil/MixAll) — can address in a follow-up if wanted.

主要语言
Java
星标
22.7k
派生
12k
平均合并
3 天 18 小时
30 天内合并 PR
17

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/rocketmq 的其他 Issue

查看 apache/rocketmq 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。