CompressionType.of fails under the Turkish locale

Open Beginner friendly
#11,512 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@sharanggupta is already working on this.

Since Nov 12, 2026.

  • #11513 by @sharanggupta — open
  • #11514 by @xixi-box — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
83/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java

Research direction

Find CompressionType.of(String) and its tests in the RocketMQ repository. Read the parsing logic and nearby tests, then run the relevant test before and after adding a regression case for Turkish locale parsing of zlib. Done means the case resolves to the ZLIB compression type under that locale; the issue identifies Locale.ROOT as the intended normalization.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Java
Stars
22.7k
Forks
12k
Avg merge
3d 18h
Merged PRs (30d)
17

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/rocketmq

All issues in apache/rocketmq

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.