Repository navigation
Description
Before Creating the Bug Report
-
I have searched the open issues of this repository and believe that this is not a duplicate.
-
This is a defect in RocketMQ Studio, not a usage question and not a defect in another Apache RocketMQ repository.
-
I can reproduce this on the current
masterbranch, or I have stated the exact version I am running below.
Studio Version
branch: master
git commit id: d50ffec
deployed as: built from source
Runtime Environment
OS: Ubuntu 24.04 (WSL2)
MySQL: 8.x, container from deploy/docker-compose.yml
browser: not applicable (API-level defect)
Connected RocketMQ Cluster
Not applicable: reproduced with a unit test (RocketMQAdminClientImplTest) on master, where DefaultMQAdminExt is mocked. The defect is in the update path itself, before any cluster call.
Build Toolchain
No response
Describe the Bug
POST /api/topics/update (and the rmq.topic.update AI tool) silently ignores an explicit writeQueues: 0. A write-queue count of 0 is a legitimate way to stop producers while consumers drain a topic, but the request behaves exactly like omitting the field: the stored queue count (or the default of 8) is applied instead.
Root cause: TopicVO declares writeQueues/readQueues as primitive int, so once UpdateTopicDTO.toTopicVO() / TopicUpdateInput.mergeWith() copy the value, an explicit 0 and an omitted field are indistinguishable. RocketMQAdminClientImpl.updateTopic then uses a > 0 check to mean "not provided".
Steps to Reproduce
- On master, run the (new) unit test
RocketMQAdminClientImplTest.updateTopicAppliesExplicitZeroQueueCounts, or: - Call
POST /api/topics/updatefor an existing 8/8 topic with body{"instanceId": "...", "name": "orders", "writeQueues": 0, "readQueues": 8}. - The broker config and the stored metadata keep
writeQueueNums: 8; the response also reports 8.
What Did You Expect to See?
An explicit writeQueues: 0 is applied to the broker topic config and the stored metadata. An omitted value continues to preserve the stored count (the fix for #4123/#4275 already established "absent keeps the stored value").
What Did You See Instead?
writeQueues: 0 is treated as "not provided" and silently replaced with the previous value or the default of 8.
Additional Context
Suggested direction: make the two TopicVO fields nullable (Integer), mirroring the optional semantics perm already uses, and let the Apache update path apply an explicit 0. I have a failing-test-first patch ready and will link the PR here shortly.
Are You Willing to Submit a Pull Request?
- Yes, I am willing to submit a pull request.
Re-submission: the original report (#4582) was closed by the stale bot after 7 days without triage activity, and GitHub now rejects reopening items in this repository. Refiled unchanged; the fix PR is linked below.
Activity
Frun1na commentedon Oct 1, 2026
Fix: #5275
Frun1na commentedon Oct 7, 2026
Friendly ping — the fix for this is in #5275 and is waiting for review; keeping the issue from the stale bot meanwhile.
Frun1na commentedon Oct 10, 2026
Friendly ping — the fix for this is in #5275 and is waiting for review; keeping the issue from the stale bot meanwhile.